]>
Commit | Line | Data |
---|---|---|
52cc906b | 1 | # |
2 | # TODO: | |
3 | # summary, desc, more BRs ?, maybe some build fix ?, | |
4 | # conditional build - maybe subpackages with sperate modules ? | |
5 | # | |
6 | %define _snap 20030212 | |
c06e786b | 7 | %define _modules login logout about clients goods invoices means_of_transport stores archive_invoices |
52cc906b | 8 | Summary: XdeFactor - New Generation |
9 | Summary(pl): XdeFactor - Nowa Generacja | |
10 | Name: XdeFactor-ng | |
11 | Version: %{_snap} | |
12 | Release: 0.1 | |
13 | License: GPL | |
14 | Group: Bzium | |
15 | BuildRequires: glib2-devel | |
16 | BuildRequires: postgresql-devel | |
c06e786b | 17 | Prereq: /sbin/ldconfig |
52cc906b | 18 | Source0: http://defactor-ng.gnu.pl/XdeFactor-ng_snapshots/%{name}_%{version}.tar.gz |
19 | Patch0: %{name}-includes.patch | |
20 | Patch1: %{name}-modules-includes.patch | |
21 | URL: http://defactor-ng.gnu.pl/ | |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
23 | ||
24 | %description | |
25 | ||
26 | %description -l pl | |
27 | ||
28 | %prep | |
29 | %setup -q -n xdefactor-ng | |
30 | %patch0 -p1 | |
31 | %patch1 -p1 | |
32 | ||
33 | %build | |
34 | cd src | |
35 | %{__make} CC="gcc %{rpmcflags}" | |
36 | ||
52cc906b | 37 | cd modules |
38 | ||
c06e786b | 39 | for i in %{_modules}; do |
52cc906b | 40 | cd $i |
41 | %{__make} CC="gcc %{rpmcflags}" | |
42 | cd .. | |
43 | done | |
44 | ||
45 | %install | |
46 | rm -rf $RPM_BUILD_ROOT | |
8a979313 | 47 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/defactor-ng/x/modules/,%{_bindir},%{_libdir}/xdefactor-ng/,%{_datadir}/%{name}} |
52cc906b | 48 | |
8a979313 | 49 | install src/xdefactor-ng $RPM_BUILD_ROOT/%{_bindir}/ |
50 | install conf/logo.jpg $RPM_BUILD_ROOT/%{_datadir}/%{name}/ | |
51 | install conf/modules.conf.example $RPM_BUILD_ROOT/%{_datadir}/%{name}/ | |
52 | install conf/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/defactor-ng/x/ | |
53 | install conf/host.name $RPM_BUILD_ROOT%{_sysconfdir}/defactor-ng/x/ | |
54 | ||
55 | cd src/modules | |
c06e786b | 56 | |
57 | for i in %{_modules}; do | |
8a979313 | 58 | cd $i |
fa06b502 | 59 | for j in *.so; do |
60 | install $j $RPM_BUILD_ROOT%{_libdir}/xdefactor-ng/ | |
61 | echo "$j" >> $RPM_BUILD_ROOT%{_sysconfdir}/defactor-ng/x/modules.conf | |
8a979313 | 62 | done |
63 | install *.conf $RPM_BUILD_ROOT%{_sysconfdir}/defactor-ng/x/modules/ | |
64 | cd .. | |
65 | done | |
66 | ||
67 | # i think it should be in XdeFactor-subpackages in post and postun scripts :) | |
52cc906b | 68 | |
c06e786b | 69 | %post |
70 | echo %{_libdir}/xdefactor-ng>> %{_sysconfdir}/ld.so.conf | |
71 | /sbin/ldconfig | |
72 | ||
73 | %postun | |
74 | cat %{_sysconfdir}/ld.so.conf | grep -v xdefactor-ng > /tmp/ld.so.conf.tmp | |
75 | mv /tmp/ld.so.conf.tmp %{_sysconfdir}/ld.so.conf | |
76 | ||
52cc906b | 77 | %clean |
8a979313 | 78 | #rm -rf $RPM_BUILD_ROOT |
52cc906b | 79 | |
80 | %files | |
81 | %defattr(644,root,root,755) | |
8a979313 | 82 | %doc AUTHORS README |
83 | %attr(755,root,root) %{_bindir}/xdefactor-ng | |
84 | %{_datadir}/%{name}/ | |
52cc906b | 85 | %{_sysconfdir}/defactor-ng/x/ |
8a979313 | 86 | %{_libdir}/xdefactor-ng/ |