/[smecontribs]/rpms/smeserver-inventory-tools/contribs7/smeserver-inventory-tools-1-7.spec
ViewVC logotype

Annotation of /rpms/smeserver-inventory-tools/contribs7/smeserver-inventory-tools-1-7.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Sat Dec 22 21:41:57 2007 UTC (16 years, 10 months ago) by slords
Branch: MAIN
Changes since 1.1: +1 -1 lines
Change Copyright to License

1 slords 1.1 %define name smeserver-inventory-tools
2     %define version 1
3     %define release 7
4     %define rpmver 4.0.4
5    
6    
7     Summary: OCS Inventory NG and GLPI are web-based Inventory tool & Information Resource-Manager
8     Name: %{name}
9     Version: %{version}
10     Release: %{release}
11 slords 1.2 License: GPL
12 slords 1.1 Group: SME/Addon
13     Source: %{name}-%{version}.tar.gz
14     Packager: Sylvain Gomez <sylvaingomez@free.fr>
15     URL: http://www.ocsinventory-ng.org/,http://www.glpi-project.org/
16     BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
17     BuildArchitectures: i386
18     Requires: e-smith-base
19     Requires: e-smith-release >= 7
20     Requires: mod_perl >= 1.99_16-4
21     Requires: monitor-edid >= 1.11-1
22     Requires: ocsinventory-ipdiscover >= 1.01-2
23     Requires: ocsinventory-agent >= 0.0.6-1
24     Requires: perl-Apache-DBI >= 0.9901-2.2
25     Requires: perl-Archive-Tar >= 1.23-3.99_2
26     Requires: perl-Compress-Zlib >= 1.42-1
27     Requires: perl-Crypt-OpenSSL-Bignum >= 0.03-1.2
28     Requires: perl-Crypt-OpenSSL-RSA >= 0.21-1.2
29     Requires: perl-IO-Socket-SSL >= 1.01-1
30     Requires: perl-IO-Zlib >= 1.04-2
31     Requires: perl-Mail-DomainKeys >= 0.21-2
32     Requires: perl-MIME-Lite >= 3.01-2.2
33     Requires: perl-Net-IP >= 1.23-1
34     Requires: perl-Net-Jabber >= 2.0-1.2
35     Requires: perl-Net-XMPP >= 1.0-1.2
36     Requires: perl-SOAP-Lite >= 0.69-1
37     Requires: perl-XML-SAX >= -0.12-7
38     Requires: perl-XML-Simple >= 2.14-4
39     Requires: perl-XML-Stream >= 1.22-1.2
40     Conflicts: smeserver-ocs_inventory_ng
41     Conflicts: smeserver-glpi
42    
43    
44     %description
45     This RPM is an unofficial addon for the SME Server 7.x.
46     OCS Inventory NG is an application designed to help a network or system administrator
47     keep track of the computers configuration and software that are installed on the network.
48     GLPI is the Information Resource-Manager with an additional Administration-Interface.
49     http://your_server/ocs
50     http://your_server/glpi
51    
52    
53     %changelog
54     * Sat Nov 10 2007 Sylvain Gomez <sylvaingomez@free.fr>
55     [1-7] Security fix
56     - Fix security issue on dbconfig.inc.php - We now use root:www 440
57     - Fix perms on ocsreports folder and ipdiscover-util.pl (750 for both)
58     - Fix problem while importing ocsagent.exe into MySQL
59     - MaxUpload limit raised to 100M by default (new install only)
60    
61     * Thu Nov 8 2007 Sylvain Gomez <sylvaingomez@free.fr>
62     [1-6] Maintenance release - Thanks again to Stefen Noble <support@dungog.net>
63     - Removed useless MySQL custom-template
64     - Removed ocsagent.exe guide.pdf
65     - Upload limit fixed
66     - 'MaxUpload' DB entry added to set dynamically max upload file size (default still at 10M)
67     - Events moved to domain-modify
68     - 2 new 'url' types added for ocs' virtual locations
69     - Uninstall script now also deletes new DB values + logs + old inventories
70     - Improved Apache templates to allow adding aliases for both web interfaces
71     - RPM runs verbosely
72    
73     * Wed Nov 7 2007 Sylvain Gomez <sylvaingomez@free.fr>
74     [1-5] Fixing Deployment feature - Thanks again to Stefen Noble <support@dungog.net>
75     - New apache template to add cacert.pem file
76     - cacert.pem is copied from your existing ssl.srt if not present
77    
78     * Tue Nov 6 2007 Sylvain Gomez <sylvaingomez@free.fr>
79     [1-4] Fixing a few bugs
80     - perl-XML-SAX added to dependencies list
81     - Fix /usr/lib/perl5/vendor_perl/5.8.5/XML/SAX/ParserDetails.ini not existing
82     - Account 'download' created with type 'url'
83    
84     * Tue Nov 6 2007 Sylvain Gomez <sylvaingomez@free.fr>
85     [1-3] Fixing a few bugs and minor changes. Thanks to Stefen Noble <support@dungog.net>
86     - MySQL database is imported with a safer method (use IF NOT EXIST)
87     - OCS Apache template modified
88     - Minor changes in the uninstall script
89     - Crond restart deleted (not needed)
90     - Launching inventory is for install only now (not update)
91     - Type changed to url instead of reserved
92    
93     * Sun Nov 4 2007 Sylvain Gomez <sylvaingomez@free.fr>
94     [1-2] Fixing a few bugs
95     - Upload fixed
96     - OCS Apache template modified
97     - ocsagent.exe is now included in ./ocs/files
98    
99     * Fri Nov 2 2007 Sylvain Gomez <sylvaingomez@free.fr>
100     [1-1] Original version
101     - OCS Inventory NG 1.01
102     - OCS Linux Agent 0.0.6
103     - GLPI 0.68.3-2
104    
105    
106     %prep
107    
108    
109     %setup
110    
111    
112     %build
113     perl createlinks
114    
115     # Default DB parameters
116     DEFAULTS1=root/etc/e-smith/db/configuration/defaults/ocs
117     DEFAULTS2=root/etc/e-smith/db/accounts/defaults/ocs
118     DEFAULTS3=root/etc/e-smith/db/configuration/defaults/glpi
119     DEFAULTS4=root/etc/e-smith/db/accounts/defaults/glpi
120     DEFAULTS5=root/etc/e-smith/db/accounts/defaults/download
121     DEFAULTS6=root/etc/e-smith/db/accounts/defaults/ocsinterface
122     DEFAULTS7=root/etc/e-smith/db/accounts/defaults/ocsinventory
123     mkdir -p $DEFAULTS1
124     mkdir -p $DEFAULTS2
125     mkdir -p $DEFAULTS3
126     mkdir -p $DEFAULTS4
127     mkdir -p $DEFAULTS5
128     mkdir -p $DEFAULTS6
129     mkdir -p $DEFAULTS7
130     echo "ocsweb" > $DEFAULTS1/DbName
131     echo "ocs" > $DEFAULTS1/DbUser
132     echo "off" > $DEFAULTS1/HTTPS
133     echo "global" > $DEFAULTS1/InventoryAccess
134     echo "600" > $DEFAULTS1/InventoryDelay
135     echo "localhost" > $DEFAULTS1/InventoryServer
136     echo "100M" > $DEFAULTS1/MaxUpload
137     echo "OCS Inventory NG" > $DEFAULTS1/Name
138     echo "local" > $DEFAULTS1/PublicAccess
139     echo "service" > $DEFAULTS1/type
140     echo "url" > $DEFAULTS2/type
141     echo "glpi" > $DEFAULTS3/DbName
142     echo "glpi" > $DEFAULTS3/DbUser
143     echo "off" > $DEFAULTS3/HTTPS
144     echo "GLPI" > $DEFAULTS3/Name
145     echo "local" > $DEFAULTS3/PublicAccess
146     echo "service" > $DEFAULTS3/type
147     echo "url" > $DEFAULTS4/type
148     echo "url" > $DEFAULTS5/type
149     echo "url" > $DEFAULTS6/type
150     echo "url" > $DEFAULTS7/type
151    
152     # Creating templates.metadata
153     TEMPLATE1=root/etc/e-smith/templates.metadata/etc/e-smith/sql/init
154     TEMPLATE2=root/etc/e-smith/templates.metadata/opt/inventory/ocs/ocsreports
155     TEMPLATE3=root/etc/e-smith/templates.metadata/opt/inventory/glpi/config
156     mkdir -p $TEMPLATE1
157     mkdir -p $TEMPLATE2
158     mkdir -p $TEMPLATE3
159     echo 'PERMS=0540' > $TEMPLATE1/80ocs_mysql.sql
160     echo 'PERMS=0540' > $TEMPLATE1/80glpi_mysql.sql
161     echo 'PERMS=0540' > $TEMPLATE1/81ocs-glpi.sql
162     echo 'UID="root"' > $TEMPLATE2/dbconfig.inc.php
163     echo 'GID="www"' >> $TEMPLATE2/dbconfig.inc.php
164     echo 'PERMS=0440' >> $TEMPLATE2/dbconfig.inc.php
165     echo 'UID="root"' > $TEMPLATE3/config_db.php
166     echo 'GID="www"' >> $TEMPLATE3/config_db.php
167     echo 'PERMS=0440' >> $TEMPLATE3/config_db.php
168    
169    
170     %install
171     rm -rf $RPM_BUILD_ROOT
172     (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
173     rm -f %{name}-%{version}-filelist
174     /sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist
175    
176    
177     %clean
178     rm -rf $RPM_BUILD_ROOT
179    
180    
181     %pre
182     # Checking if Inventory files are present before updating
183     # If present, installation files + MySQL DB + DB values are saved
184     if [ -d /opt/inventory ]; then
185     case $LANG in
186     fr_FR) echo "Sauvegarde de l'ancienne install dans /opt/RPM_BACKUP" ;;
187     *) echo "Backing up old install in /opt/RPM_BACKUP" ;;
188     esac
189     mkdir -p /opt/RPM_BACKUP
190     cd /opt
191     tar -czf /opt/RPM_BACKUP/ocs_glpi.tar.gz inventory
192     if [ -d /opt/inventory/ocs ] ; then
193     mysqldump ocsweb > /opt/RPM_BACKUP/ocs.sql
194     fi
195     if [ -d /opt/inventory/glpi ] ; then
196     mysqldump glpi > /opt/RPM_BACKUP/glpi.sql
197     fi
198     /sbin/e-smith/db configuration show ocs > /opt/RPM_BACKUP/ocs_glpi-config.txt
199     echo " " >> /opt/RPM_BACKUP/ocs_glpi-config.txt
200     /sbin/e-smith/db configuration show glpi >> /opt/RPM_BACKUP/ocs_glpi-config.txt
201     fi
202    
203    
204     %post
205     # Initializing SME DB
206     /etc/e-smith/events/actions/initialize-default-databases
207    
208     # Variables
209     DOMAIN=$(/sbin/e-smith/db configuration get DomainName)
210     SRVNAME=$(/sbin/e-smith/db configuration get SystemName)
211     UPDATE=$(ls /opt | grep -c inventory)
212     if [ -d /opt/inventory/ocs ] ; then UPDTOCS=1 ; else UPDTOCS=0 ; fi
213     if [ -d /opt/inventory/glpi ] ; then UPDTGLPI=1 ; else UPDTGLPI=0 ; fi
214    
215     # Decompressing files
216     mkdir -p /opt/inventory
217     tar -xzf /usr/share/doc/smeserver-OCS_GLPI/Sources/ocs.tar.gz -C /opt/inventory
218     tar -xzf /usr/share/doc/smeserver-OCS_GLPI/Sources/glpi.tar.gz -C /opt/inventory
219    
220     # Preparing configuration
221     mkdir -p /var/log/ocsinventory-NG
222     chown www:www /var/log/ocsinventory-NG
223     chmod 775 /var/log/ocsinventory-NG
224     rm -rf /opt/inventory/conf
225     rm -f /etc/ocsinventory-agent/ocsinv.conf
226     mv /usr/lib/perl5/site_perl/5.8.5/Apache/Ocsinventory/Server/Modperl2.pm.txt /usr/lib/perl5/site_perl/5.8.5/Apache/Ocsinventory/Server/Modperl2.pm
227     if [ "$UPDTOCS" = "0" ] ; then
228     cp /usr/share/doc/smeserver-OCS_GLPI/Sources/ocs.sql /etc/e-smith/sql/init/81ocs_db.sql
229     fi
230     if [ "$UPDTGLPI" = "0" ] ; then
231     cp /usr/share/doc/smeserver-OCS_GLPI/Sources/glpi-$LANG.sql /etc/e-smith/sql/init/83glpi_db.sql
232     fi
233     /sbin/e-smith/config setprop modPerl status enabled
234     /sbin/e-smith/config setprop mysqld InnoDB enabled
235    
236     # Fixing XML::SAX ParserDetails.ini
237     if [ ! -e /usr/lib/perl5/vendor_perl/5.8.5/XML/SAX/ParserDetails.ini ]; then
238     touch /usr/lib/perl5/vendor_perl/5.8.5/XML/SAX/ParserDetails.ini
239     chmod 444 /usr/lib/perl5/vendor_perl/5.8.5/XML/SAX/ParserDetails.ini
240     perl -MXML::SAX -e "XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()"
241     fi
242    
243     # Copying SME's certificate into cacert.pem if the file do not exist
244     # This file is used by deployment function
245     if [ ! -e /home/e-smith/ssl.crt/cacert.pem ]; then
246     cp /home/e-smith/ssl.crt/$SRVNAME.$DOMAIN.crt /home/e-smith/ssl.crt/cacert.pem
247     fi
248    
249     # Applying modifications
250     /sbin/e-smith/expand-template /etc/my.cnf
251     service mysqld restart 2>/dev/null >/dev/null
252     /sbin/e-smith/signal-event domain-modify
253    
254     if [ "$UPDTOCS" = "0" ] ; then
255     case $LANG in
256     fr_FR) echo "Inventaire du serveur SME en cours, veuillez patienter..." ;;
257     *) echo "Inventorying SME Server, please wait this may take a while..." ;;
258     esac
259     /usr/sbin/ocsinventory-agent -s localhost
260     fi
261    
262     echo "-------------------------------------------------------------------------------"
263     case $LANG in
264     fr_FR)
265     case $UPDATE in
266     0) echo "Installation d'OCS Inventory NG (Serveur+Agent) & GLPI terminée !" ;;
267     *) echo "Mise à jour d'OCS Inventory NG (Serveur+Agent) & GLPI terminée !" ;;
268     esac
269     echo "Pour plus de détails, visitez http://wiki.contribs.org/OCS_Inventory_Tools/fr" ;;
270     *)
271     case $UPDATE in
272     0) echo "OCS Inventory NG (Server+Agent) & GLPI Installation finished!" ;;
273     *) echo "OCS Inventory NG (Server+Agent) & GLPI Update finished!" ;;
274     esac
275     echo "For more details, see http://wiki.contribs.org/OCS_Inventory_Tools" ;;
276     esac
277     echo "-------------------------------------------------------------------------------"
278    
279    
280     %preun
281     if [ $1 = 0 ] ; then
282     mv /usr/share/doc/smeserver-OCS_GLPI/Sources/DO_NOT_USE_OR_DELETE/OCS_GLPI-Full-Uninstall.sh /root/
283     mv /usr/lib/perl5/site_perl/5.8.5/Apache/Ocsinventory/Server/Modperl2.pm /usr/lib/perl5/site_perl/5.8.5/Apache/Ocsinventory/Server/Modperl2.pm.txt
284     fi
285    
286    
287     %postun
288     if [ $1 = 0 ] ; then
289     # Restoring default default values..."
290     /sbin/e-smith/config setprop mysqld InnoDB disabled
291     /sbin/e-smith/expand-template /etc/my.cnf
292     service mysqld restart 2>/dev/null >/dev/null
293     /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
294     /etc/rc7.d/S86httpd-e-smith sigusr1 2>/dev/null >/dev/null
295    
296     echo "Uninstallation finished!"
297     echo " "
298     echo "If you want to completly remove OCS & GLPI"
299     echo "(installation files, MySQL user+database and Agent RPMs)"
300     echo "please issue the following command at the prompt:"
301     echo "# sh /root/OCS_GLPI-Full-Uninstall.sh"
302     fi
303    
304    
305     %files -f %{name}-%{version}-filelist
306    
307    
308     %defattr(-,root,root)

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed