3 %bcond_with tests # build with tests
4 %bcond_without tests # build without tests
11 License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
13 # SF URL: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
14 # github URL https://github.com/USER/PROJECT/archive/v%{version}/%{name}-%{version}.tar.gz
15 Source0: %{name}-%{version}.tar.gz
19 #Patch0: %{name}-DESTDIR.patch
21 # if using noarch subpackage
22 #BuildRequires: rpm-build >= 4.6
23 %if %{with initscript}
24 BuildRequires: rpmbuild(macros) >= 1.228
25 Requires(post,preun): /sbin/chkconfig
28 %if %{with systemd_service}
29 BuildRequires: rpmbuild(macros) >= 2.011
30 Requires(post,preun,postun): systemd-units >= 250.1
31 Requires: systemd-units >= 250.1
33 %if %{with systemd_user_service}
34 BuildRequires: rpmbuild(macros) >= 2.011
35 Requires(post,preun): systemd-units >= 250.1
36 Requires: systemd-units >= 250.1
39 #BuildRequires: autoconf
40 #BuildRequires: automake
41 #BuildRequires: intltool
42 #BuildRequires: libtool
44 #Requires(pre,post): -
53 #ExclusiveArch: %{ix86}
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 %description -l pl.UTF-8
66 %description subpackage
68 %description subpackage -l pl.UTF-8
77 %description libs -l pl.UTF-8
80 Summary: Header files for %{name} library
81 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name}
82 Group: Development/Libraries
83 # if base package contains shared library for which these headers are
84 #Requires: %{name} = %{version}-%{release}
85 # if -libs package contains shared library for which these headers are
86 #Requires: %{name}-libs = %{version}-%{release}
89 Header files for %{name} library.
91 %description devel -l pl.UTF-8
92 Pliki nagłówkowe biblioteki %{name}.
95 Summary: Static %{name} library
96 Summary(pl.UTF-8): Statyczna biblioteka %{name}
97 Group: Development/Libraries
98 Requires: %{name}-devel = %{version}-%{release}
101 Static %{name} library.
103 %description static -l pl.UTF-8
104 Statyczna biblioteka %{name}.
109 #%setup -q -n %{name}
110 #%setup -q -n %{name}-%{version}.orig -a 1
114 #find '(' -name '*.php' -o -name '*.inc' ')' -print0 | xargs -0 %{__sed} -i -e 's,\r$,,'
116 # remove CVS control files
117 #find -name CVS -print0 | xargs -0 rm -rf
119 # you'll need this if you cp -a complete dir in source
120 # cleanup backups after patching
121 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
124 # if ac/am/* rebuilding is necessary, do it in this order and add
125 # appropriate BuildRequires
133 # if not running libtool or automake, but config.sub is too old:
134 #cp -f /usr/share/automake/config.sub .
139 # CFLAGS="%{rpmcflags}" \
140 # LDFLAGS="%{rpmldflags}"
142 %{?with_tests:%{__make} test}
145 rm -rf $RPM_BUILD_ROOT
146 # create directories if necessary
147 #install -d $RPM_BUILD_ROOT
148 %if %{with initscript}
149 install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
151 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
154 DESTDIR=$RPM_BUILD_ROOT
157 rm -rf $RPM_BUILD_ROOT
160 %groupadd -g xxx %{name}
161 %useradd -u xxx -d /var/lib/%{name} -g %{name} -c "XXX User" %{name}
168 if [ "$1" = "0" ]; then
174 %post -p /sbin/ldconfig
175 %postun -p /sbin/ldconfig
178 %if %{with initscript}
180 /sbin/chkconfig --add %{name}
181 %service %{name} restart
184 if [ "$1" = "0" ]; then
185 %service -q %{name} stop
186 /sbin/chkconfig --del %{name}
190 %if %{with systemd_service}
192 %systemd_post %{name}.service
195 %systemd_preun %{name}.service
198 #%systemd_postun %{name}.service
199 %systemd_postun_with_restart %{name}.service
202 %if %{with systemd_user_service}
204 %systemd_user_post %{name}.service
207 %systemd_user_preun %{name}.service
211 %defattr(644,root,root,755)
212 %doc AUTHORS CREDITS CHANGES ChangeLog NEWS README THANKS TODO
215 # if _sysconfdir != /etc:
216 #%%dir %{_sysconfdir}
217 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
218 %attr(755,root,root) %{_bindir}/%{name}*
222 # initscript and its config
223 %if %{with initscript}
224 %attr(754,root,root) /etc/rc.d/init.d/%{name}
225 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
228 %if %{with systemd_service}
229 %{systemdunitdir}/%{name}.service
232 %if %{with systemd_user_service}
233 %{systemduserunitdir}/%{name}.service
236 #%{_examplesdir}/%{name}-%{version}
238 %if %{with subpackage}
240 %defattr(644,root,root,755)
242 #%{_datadir}/%{name}-ext