]> git.pld-linux.org Git - packages/dgee.git/blob - dgee.spec
- do more tests in post and preun section
[packages/dgee.git] / dgee.spec
1 #
2 # TODO: 
3 #  --without apache1 (default) should build mod_dgee.so for 
4 #  apache2 - it doesn't
5
6
7 %bcond_with     apache1
8 %define         apxs    /usr/sbin/apxs
9 %define         _rel    2
10 Summary:        The DotGNU Execution Environment Core
11 Name:           dgee
12 Version:        0.1.6
13 Release:        %{_rel}.0.2
14 Source0:        http://www.nfluid.com/download/src/%{name}-%{version}-%{_rel}.tgz
15 # Source0-md5:  a2573a076832c4c7212479cabda15eff
16 Source1:        %{name}.init
17 Source2:        %{name}.logrotate
18 Patch0:         %{name}-DESTDIR.patch
19 Patch1:         %{name}-apache.patch
20 Patch2:         %{name}-dglib_fix_so.patch
21 Patch3:         %{name}-pythonvm.patch
22 License:        GPL
23 Vendor:         DotGNU
24 Group:          Networking/Daemons
25 BuildRequires:  apache-devel
26 BuildRequires:  expat-devel
27 BuildRequires:  goldwater-devel => 0.3.4
28 BuildRequires:  phlib-devel => 1.20
29 BuildRequires:  pnet-devel => 0.6.0-2
30 BuildRequires:  %{apxs}
31 Requires:       apache
32 Requires:       goldwater
33 Requires(post,preun):   %{apxs}
34 Requires(post,preun):   /sbin/chkconfig
35 Requires(post,postun):  /sbin/ldconfig
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %description
39 The core DotGNU Execution Environment that provides the functionality
40 of accepting, validating and satisfying web service requests.
41
42 %prep
43 %setup -q
44 %patch0 -p1
45 %patch1 -p1
46 %patch2 -p1
47 %patch3 -p1
48
49 %build
50 %{__aclocal}
51 %{__autoconf}
52 %{__automake}
53 %configure \
54         --with-goldwater=%{_prefix} \
55         --with-pnet=%{_prefix} \
56         --with-repository=/var/lib/%{name} \
57         --with-username=http \
58         --with-usergroup=http \
59         --with-python \
60 %if %{with apache1}
61         --with-apache=%{_prefix}
62 %else
63         --without-apache \
64         --with-apache2=%{_prefix}
65 %endif
66
67 %if %{with apache1}
68 %{__make} 
69 %else
70 %{__make} \
71         APACHE=
72 %endif
73
74 %install
75 rm -rf $RPM_BUILD_ROOT
76 %if %{with apache1}
77 %{__make} install \
78         DESTDIR=$RPM_BUILD_ROOT 
79 %else
80 %{__make} install \
81         DESTDIR=$RPM_BUILD_ROOT \
82         APACHE=
83 %endif
84 # Thise files should be installed by Makefile (I can't fix it):
85 install cslib/DotGNU/DGEE/DotGNU.DGEE.dll \
86         $RPM_BUILD_ROOT/%{_libdir}/%{name}
87 install cslib/System/Web/Services/System.Web.Services.dll \
88         $RPM_BUILD_ROOT/%{_libdir}/%{name}
89 install cslib/DotGNU/DGEE/Protocols/XmlRpc/XmlRpcService.exe \
90         $RPM_BUILD_ROOT/%{_libdir}/%{name}
91
92 install -d $RPM_BUILD_ROOT/var/lib/%{name}/{index,data}
93 install -d $RPM_BUILD_ROOT/var/log/%{name}
94 touch $RPM_BUILD_ROOT/var/log/%{name}/{%{name}.log,stdout,stderr}
95 install -d $RPM_BUILD_ROOT/var/log/archiv/%{name}
96 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
97 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
98 install -d $RPM_BUILD_ROOT/etc/logrotate.d
99 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
100
101
102 %post
103 %if %{with apache1}
104 if [ -f /etc/httpd/httpd.conf ] && \
105     ! grep -q "^Include.*/mod_dgee.conf" /etc/httpd/httpd.conf; then
106         echo "Include /etc/httpd/mod_dgee.conf" >> /etc/httpd/httpd.conf
107 fi
108 %endif
109
110 %{apxs} -e -a -n dgee %{_pkglibdir}/mod_dgee.so 1>&2
111 if [ -f /var/lock/subsys/httpd ]; then
112         /etc/rc.d/init.d/httpd restart 1>&2
113 fi
114
115 /sbin/ldconfig
116
117 if [ -f /var/lock/subsys/dgee ]; then
118         /etc/rc.d/init.d/dgee restart 1>&2
119 else
120         echo "Run \"/etc/rc.d/init.d/dgee start\" to start goltwater and dgee services."
121 fi
122 /sbin/chkconfig --add dgee
123
124 %preun
125 if [ "$1" = "0" ]; then
126 %if %{with apache1}
127         umask 027
128         grep -E -v "^Include.*/mod_dgee.conf" /etc/httpd/httpd.conf > \
129                 /etc/httpd/httpd.conf.tmp
130         mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
131 %endif
132         %{apxs} -e -A -n dgee %{_pkglibdir}/mod_dgee.so 1>&2
133         if [ -f /var/lock/subsys/httpd ]; then
134                 /etc/rc.d/init.d/httpd restart 1>&2
135         fi
136         if [ -f /var/lock/subsys/dgee ]; then
137                 /etc/rc.d/init.d/dgee stop 1>&2
138         fi
139         /sbin/chkconfig --del dgee
140 fi
141
142 %postun
143 /sbin/ldconfig
144
145 %clean
146 #rm -rf $RPM_BUILD_ROOT
147
148 %files
149 %defattr(644,root,root,755)
150 %doc BINARYINSTALL INSTALL QUICKSTART README COPYING
151 %attr(755,root,root) %{_bindir}/*
152 %config %{_sysconfdir}/%{name}*
153 %dir %{_libdir}/%{name}
154 %attr(755,root,root) %{_libdir}/%{name}/*
155 %{_libdir}/libdgee.*
156 %{_libdir}/libdgxml.*
157 %if %{with apache1}
158 %config %{_sysconfdir}/httpd/mod_%{name}.conf
159 %{_libdir}/apache/mod_%{name}.so
160 %else
161 #%config %{_sysconfdir}/httpd/mod_%{name}.conf
162 #%{_libdir}/apache/mod_%{name}.so
163 %endif
164 %{_datadir}/%{name}
165 /var/lib/%{name}
166 %attr(754,root,root) /etc/rc.d/init.d/%{name}
167 %attr(730,root,http) %dir /var/log/%{name}
168 %attr(660,root,http) /var/log/%{name}/*
169 %attr(750,root,root) %dir /var/log/archiv/%{name}
170 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/*
171
172 # Local variables:
173 # mode: rpm-spec
174 # end:
This page took 0.085348 seconds and 3 git commands to generate.