]> git.pld-linux.org Git - packages/ct-crm.git/blob - ct-crm.spec
- unify
[packages/ct-crm.git] / ct-crm.spec
1 # TODO:
2 # - make it work without global_variables=On
3 Summary:        A CRM for small to medium firms
4 Summary(pl):    CRM dla ma³ych i ¶rednich instytucji
5 Name:           ct-crm
6 Version:        1.6
7 %define         _pre    pre
8 Release:        0.%{_pre}.2
9 License:        GPL
10 Group:          Applications/WWW
11 Source0:        http://dl.sourceforge.net/customer-touch/%{name}%{version}%{_pre}.zip
12 # Source0-md5:  ffe5c4e7b183173832f4c1157a645e05
13 Source1:        %{name}-polish_lang
14 Source2:        %{name}.conf
15 Patch0:         %{name}-lang_pl.patch
16 Patch1:         %{name}-dbz.patch
17 Patch2:         %{name}-ne.patch
18 URL:            http://www.customer-touch.com/
19 BuildRequires:  unzip
20 Requires:       php-mysql
21 Requires:       webserver
22 BuildRequires:  sed >= 4.0
23 BuildArch:      noarch
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %define         _appdir %{_datadir}/%{name}
27 %define         _sysconfdir     /etc/%{name}
28
29 %description
30 An easy to use and install CRM for small to medium firms.
31
32 %description -l pl
33 Prosty w u¿yciu i instalacji CRM (Customer Relationship Management)
34 dla ma³ych i ¶rednich instytucji.
35
36 %prep
37 %setup -q -n %{name}%{version}
38 %patch0 -p1
39 %patch1 -p1
40 %patch2 -p1
41
42 for i in *.php */*.php; do
43         %{__sed} -i -e '
44                 s#\"config.inc.php\"#\"%{_sysconfdir}/config.inc.php\"#
45                 s#\"includes/config.inc.php\"#\"%{_sysconfdir}/config.inc.php\"#
46         ' $i
47 done
48
49 %install
50 rm -rf $RPM_BUILD_ROOT
51 install -d $RPM_BUILD_ROOT{%{_appdir}/{Doc/manual_install,languages/polish},/etc/httpd,%{_sysconfdir}}
52
53 for i in uploads modules languages includes images email ; do
54         cp -Rf $i $RPM_BUILD_ROOT%{_appdir}
55 done
56 install *.php *.js *.css $RPM_BUILD_ROOT%{_appdir}
57 cp -Rf Doc/manual_install/* $RPM_BUILD_ROOT%{_appdir}/Doc/manual_install
58
59 touch $RPM_BUILD_ROOT%{_sysconfdir}/config.inc.php
60
61 install %{SOURCE1} $RPM_BUILD_ROOT%{_appdir}/languages/polish/global.inc.php
62 install %{SOURCE2} $RPM_BUILD_ROOT/etc/httpd
63
64 %clean
65 rm -rf $RPM_BUILD_ROOT
66
67 %post
68 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*%{name}.conf" /etc/httpd/httpd.conf; then
69         echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
70 fi
71 if [ -f /var/lock/subsys/httpd ]; then
72         /usr/sbin/apachectl restart 1>&2
73 fi
74
75 %preun
76 if [ "$1" = "0" ]; then
77         umask 027
78         grep -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
79                 /etc/httpd/httpd.conf.tmp
80         mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
81         if [ -f /var/lock/subsys/httpd ]; then
82                 /usr/sbin/apachectl restart 1>&2
83         fi
84 fi
85
86 %files
87 %defattr(644,root,root,755)
88 %doc Doc/*.txt Doc/{CHANGELOG,README} Doc/manual_install/readme
89 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/httpd/%{name}.conf
90 %attr(750,root,http) %dir %{_sysconfdir}
91 %attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.inc.php
92 %dir %{_appdir}
93 %{_appdir}/*.css
94 %{_appdir}/[!^c]*.php
95 %{_appdir}/c[asu]*.php
96 %{_appdir}/*.js
97 %dir %{_appdir}/uploads
98 %dir %{_appdir}/modules
99 %{_appdir}/modules/mwhois
100 %dir %{_appdir}/languages
101 %{_appdir}/languages/*/global.inc.php
102 %dir %{_appdir}/includes
103 %{_appdir}/includes/*.php
104 %dir %{_appdir}/images
105 %{_appdir}/images/*.gif
106 %dir %{_appdir}/email
107 %{_appdir}/email/readme.txt
108 %dir %{_appdir}/Doc
109 %{_appdir}/Doc/manual_install
This page took 0.0754359999999999 seconds and 3 git commands to generate.