source: projects/fossology/pbconf/trunk/fossology/rpm/fossology.spec @ 610

Revision 610, 4.3 KB checked in by bruno, 4 years ago (diff)
  • Use of a new macro PBPHPINI for PHP configuration in post-install of fossology
  • libmagic-devel is a mandriva dependency only. fedora needs file-devel, rhel file.
  • use LIBDIR in make install to deal with 64 bits support.
  • Remains only the /etc/default part to handle
Line 
1#
2# $Id$
3#
4# Used if virtual name != real name (perl, ...)
5#%define srcname        PBPKG
6
7Name:           PBREALPKG
8Version:        PBVER
9Release:        PBTAGPBSUF
10License:        PBLIC
11Group:          PBGRP
12Url:            PBURL
13Source:         PBREPO/PBSRC
14#PBPATCHSRC
15BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
16Requires:       postgresql php php-pear php-pgsql libxml2 binutils bzip2 cpio mkisofs poppler-utils rpm tar unzip gzip httpd PBDEP
17BuildRequires:  postgresql-devel libxml2 gcc make perl PBBUILDDEP
18Summary:        FOSSology is a licenses exploration tool
19Summary(fr):    FOSSology est un outil d'exploration de licenses
20
21%package devel
22Summary:        Devel part of FOSSology (a licenses exploration tool)
23Summary(fr):    Partie dedévelopment de FOSSology, outil d'exploration de licenses
24Group:          PBGRP
25
26%description
27PBDESC
28
29%description -l fr
30FOSSology est un outil d'exploration de licenses
31
32%description devel
33Devel part.
34PBDESC
35
36%description -l fr devel
37Partie développement de FOSSology, outil d'exploration de licenses
38
39%prep
40%setup -q
41#PBPATCHCMD
42
43%build
44make %{?_smp_mflags} SYSCONFDIR=%{_sysconfdir}
45
46%install
47%{__rm} -rf $RPM_BUILD_ROOT
48make DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_usr} SYSCONFDIR=%{_sysconfdir} LOCALSTATEDIR=%{_var} LIBDIR=%{_libdir} install
49mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d
50cat > $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/PBPROJ.conf << EOF
51Alias /repo/ /usr/share/PBPROJ/www/
52<Directory "/usr/share/PBPROJ/www">
53        AllowOverride None
54        Options FollowSymLinks MultiViews
55        Order allow,deny
56        Allow from all
57        # uncomment to turn on php error reporting
58        #php_flag display_errors on
59        #php_value error_reporting 2039
60</Directory>
61EOF
62
63%clean
64%{__rm} -rf $RPM_BUILD_ROOT
65
66%files
67%defattr(-,root,root)
68%doc ChangeLog
69%doc COPYING COPYING.LGPL HACKING README INSTALL INSTALL.multi LICENSE
70#AUTHORS NEWS
71%dir %{_datadir}/*
72%dir %{_localstatedir}/PBPROJ
73%dir %{_libdir}/PBPROJ
74%dir %{_sysconfdir}/PBPROJ
75%dir %{_datadir}/PBPROJ
76%{_sysconfdir}/PBPROJ/*
77%{_usr}/lib/PBPROJ/*
78%{_localstatedir}/PBPROJ/*
79%{_datadir}/PBPROJ/*
80%{_sysconfdir}/httpd/conf.d/*.conf
81%{_sysconfdir}/cron.d/*
82%{_sysconfdir}/init.d/*
83%{_bindir}/*
84%{_mandir}/man1/*
85
86%files devel
87%{_includedir}/*
88%{_libdir}/*.a
89
90%post
91# Adjust the kernel shmmax (described in detail in section 2.1.3)
92echo 512000000 > /proc/sys/kernel/shmmax
93grep -q kernel.shmmax /etc/sysctl.conf
94if [ $? -eq 0 ]; then
95        perl -pi -e "s/kernel.shmmax\s*=.*/kernel.shmmax=512000000/" /etc/sysctl.conf
96else
97        echo "kernel.shmmax=512000000" >> /etc/sysctl.conf
98fi
99# Adjust postgresql config (described in detail in section 2.1.4)
100#  266 > #hba_file = 'ConfigDir/pg_hba.conf'    # host-based authentication file
101#  267 > #ident_file = 'ConfigDir/pg_ident.conf'        # IDENT configuration file
102#  268 > #external_pid_file = '(none)'          # write an extra pid file
103#  269 > listen_addresses = '*'
104#  270 > max_connections = 50
105#  271 > #shared_buffers = 1000         # min 16 or max_connections*2, 8KB each
106#  272 > shared_buffers = 32768
107#  273 > work_mem = 10240 
108#  274 > max_fsm_pages = 100000         # min max_fsm_relations*16, 6 bytes each
109#  275 > fsync = off   
110#  276 > full_page_writes = off         #recover from partial page writes
111#  277 > commit_delay = 1000
112#  278 > effective_cache_size = 25000
113#  279 > log_min_duration_statement = -1        # -1 is disabled, 0 logs all statements
114#  280 > #log_line_prefix = ''                  # Special values:
115
116# Adjust PHP config (described in detail in section 2.1.5)
117grep -qw memory_limit PBPHPINI
118if [ $? -eq 0 ]; then
119        perl -pi -e "s/memory_limit.*=.*/memory_limit = 702M/" PBPHPINI
120else
121        echo "memory_limit = 702M" >> PBPHPINI
122fi
123grep -qw post_max_size PBPHPINI
124if [ $? -eq 0 ]; then
125        perl -pi -e "s/post_max_size.*=.*/post_max_size = 702M/" PBPHPINI
126else
127        echo "post_max_size = 702M" >> PBPHPINI
128fi
129grep -qw upload_max_filesize PBPHPINI
130if [ $? -eq 0 ]; then
131        perl -pi -e "s/upload_max_filesize.*=.*/upload_max_filesize = 702M/" PBPHPINI
132else
133        echo "upload_max_filesize = 702M" >> PBPHPINI
134fi
135
136# Add apache config for fossology (described in detail in section 2.1.6) - done in install
137/etc/init.d/httpd reload
138
139# Run the postinstall script
140/usr/lib/PBPROJ/fo-postinstall
141
142# Test that things are installed correctly
143/usr/lib/PBPROJ/fossology-scheduler -t
144if [ $? -ne 0 ]; then
145        exit -1
146fi
147
148chkconfig --add PBPROJ
149/etc/init.d/PBPROJ start
150
151%changelog
152PBLOG
153
Note: See TracBrowser for help on using the repository browser.