]> git.pld-linux.org Git - packages/XdeFactor-ng.git/blob - XdeFactor-ng.spec
- cosmetics
[packages/XdeFactor-ng.git] / XdeFactor-ng.spec
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
7 #%define                _modules login logout about clients goods invoices means_of_transport stores archive_invoices
8 %define         _modules login
9 Summary:        XdeFactor - New Generation
10 Summary(pl):    XdeFactor - Nowa Generacja
11 Name:           XdeFactor-ng
12 Version:        %{_snap}
13 Release:        0.1
14 License:        GPL
15 Group:          Applications
16 BuildRequires:  glib2-devel
17 BuildRequires:  postgresql-devel
18 Prereq:         /sbin/ldconfig
19 Source0:        http://defactor-ng.gnu.pl/XdeFactor-ng_snapshots/%{name}_%{version}.tar.gz
20 Patch0:         %{name}-includes.patch
21 Patch1:         %{name}-modules-includes.patch
22 URL:            http://defactor-ng.gnu.pl/
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25 %description
26
27 %description -l pl
28
29 %package module-login
30 Summary:        XdeFactor - Login Module
31 Summary(pl):    XdeFacotr - Modó³ logowania
32 Group:          Applications
33 Requires:       %{name} = %{version}
34
35 %description module-login
36
37 %description module-login -l pl
38
39 %prep
40 %setup -q -n xdefactor-ng
41 %patch0 -p1
42 %patch1 -p1
43
44 %build
45 cd src
46 %{__make} CC="gcc %{rpmcflags}"
47
48 cd modules
49
50 for i in %{_modules}; do
51  cd $i
52  %{__make} CC="gcc %{rpmcflags}"
53  cd ..
54 done
55
56 %install
57 rm -rf $RPM_BUILD_ROOT
58 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/defactor-ng/x/modules/,%{_bindir},%{_libdir}/xdefactor-ng/,%{_datadir}/%{name}}
59
60 install src/xdefactor-ng $RPM_BUILD_ROOT/%{_bindir}/
61 install conf/logo.jpg $RPM_BUILD_ROOT/%{_datadir}/%{name}/
62 install conf/modules.conf.example $RPM_BUILD_ROOT/%{_datadir}/%{name}/
63 install conf/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/defactor-ng/x/
64 install conf/host.name $RPM_BUILD_ROOT%{_sysconfdir}/defactor-ng/x/
65
66 cd src/modules
67          
68 for i in %{_modules}; do
69  cd $i
70 for j in *.so; do
71   install $j $RPM_BUILD_ROOT%{_libdir}/xdefactor-ng/
72  done
73  install *.conf $RPM_BUILD_ROOT%{_sysconfdir}/defactor-ng/x/modules/
74  cd ..
75 done
76
77 # i think it should be in XdeFactor-subpackages in post and postun scripts :)
78
79 %post   
80 echo %{_libdir}/xdefactor-ng>> %{_sysconfdir}/ld.so.conf
81 /sbin/ldconfig
82
83 %postun
84 cat %{_sysconfdir}/ld.so.conf | grep -v xdefactor-ng > /tmp/ld.so.conf.tmp
85 mv /tmp/ld.so.conf.tmp %{_sysconfdir}/ld.so.conf
86
87 /sbin/ldconfig
88
89 %post module-login
90 echo "/modules/Login.conf" >> %{_sysconfdir}/defactor-ng/x/modules.conf
91 echo "libxdef_login.so" >> %{_sysconfdir}/defactor-ng/x/modules.conf
92 chmod 644 %{_sysconfdir}/defactor-ng/x/modules.conf
93 /sbin/ldconfig
94
95 %postun module-login
96 cat %{_sysconfdir}/defactor-ng/x/modules.conf | grep -v -i login > /tmp/xdf-modules.conf.tmp
97 mv /tmp/xdf-modules.conf.tmp %{_sysconfdir}/defactor-ng/x/modules.conf
98 chmod 644 %{_sysconfdir}/defactor-ng/x/modules.conf
99 /sbin/ldconfig
100
101 %clean
102 #rm -rf $RPM_BUILD_ROOT
103
104 %files
105 %defattr(644,root,root,755)
106 %doc AUTHORS README
107 %attr(755,root,root) %{_bindir}/xdefactor-ng
108 %{_datadir}/%{name}/
109 %{_sysconfdir}/defactor-ng/x/*.conf
110 %{_sysconfdir}/defactor-ng/x/host.name
111 #%{_libdir}/xdefactor-ng/
112
113 %files module-login
114 %defattr(644,root,root,755)
115 %{_libdir}/xdefactor-ng/libxdef_login.so
116 %{_sysconfdir}/defactor-ng/x/modules/Login.conf
This page took 0.125504 seconds and 4 git commands to generate.