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