Added section on deployment + compilation on generic Unix
[yaz4j-moved-to-github.git] / yaz4j.spec
1 # spec file for yaz4j
2 %define idmetaversion %(. ./IDMETA; echo $VERSION|tr -d '\n')
3 Name:           yaz4j
4 Version:        %{idmetaversion}
5 Release:        1.indexdata
6 Summary:        Z39.50 client toolkit for Java
7
8 Group:          Applications/Internet
9 License:        BSD
10 URL:            http://www.indexdata.com/yaz4j
11 Source0:        yaz4j-%{version}.tar.gz
12 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
13
14 BuildRequires:  libyaz5-devel
15 BuildRequires:  redhat-rpm-config 
16 BuildRequires:  maven3-indexdata
17 BuildRequires:  swig
18
19 Requires:       libyaz5
20
21 %description
22 yaz4j is a toolkit for Java which includes a wrapper for the ZOOM API of YAZ.
23 This allows developers to write Z39.50/SRU clients in Java. yaz4j supports
24 both search and scan. See the javadoc for details.
25
26 %package -n yaz4j-tomcat6
27 Summary:        yaz4j tomcat6 integration via symlink
28 Requires:       yaz4j = %{version}
29 Requires:       tomcat6
30 Group:          Applications/Internet
31
32 %description -n yaz4j-tomcat6
33 tomcat6 stuff.
34
35 %post
36 /sbin/ldconfig
37
38 %postun
39 /sbin/ldconfig
40
41 %post -n yaz4j-tomcat6
42 ln -sf %{_datadir}/java/yaz4j.jar /usr/share/tomcat6/lib
43
44 %preun -n yaz4j-tomcat6
45 if [ $1 = 0 ]; then
46         rm -f /usr/share/tomcat6/lib/yaz4j.jar
47 fi
48
49 %prep
50 %setup -q
51
52 %build
53 mvn-id package
54
55 %install
56 rm -rf %{RPM_BUILD_ROOT}
57 mkdir -p ${RPM_BUILD_ROOT}/%{_datadir}/java
58 cp any/target/yaz4j.jar ${RPM_BUILD_ROOT}/%{_datadir}/java
59 mkdir -p ${RPM_BUILD_ROOT}/%{_libdir}
60 cp unix/target/libyaz4j.so ${RPM_BUILD_ROOT}/%{_libdir}
61
62 %clean
63 rm -rf %{RPM_BUILD_ROOT}
64
65 %files
66 %defattr(-,root,root,-)
67 %{_datadir}/java/yaz4j.jar
68 %{_libdir}/*.so
69 %doc
70
71 %files -n yaz4j-tomcat6
72
73 %changelog
74