[packages/ocs-inventory-ng] - replace -config.patch with sed calls, easier to maintain

adamg adamg at pld-linux.org
Fri Mar 1 14:08:57 CET 2013


commit 1d2a368c9ae284d1a9d3a582d8df8bb1c20299ad
Author: Adam Gołębiowski <adamg at pld-linux.org>
Date:   Mon Feb 25 13:06:41 2013 +0100

    - replace -config.patch with sed calls, easier to maintain

 ocs-inventory-ng-config.patch | 39 ---------------------------------------
 ocs-inventory-ng.spec         | 19 +++++++++++++++----
 2 files changed, 15 insertions(+), 43 deletions(-)
---
diff --git a/ocs-inventory-ng.spec b/ocs-inventory-ng.spec
index 0f26dcd..4a834b6 100644
--- a/ocs-inventory-ng.spec
+++ b/ocs-inventory-ng.spec
@@ -8,7 +8,6 @@ License:	GPL
 Group:		Applications
 Source0:	https://launchpad.net/ocsinventory-server/stable-2.0/2.0.5/+download/OCSNG_UNIX_SERVER-%{version}.tar.gz
 # Source0-md5:	349904d03494b8fd9fc4eea1d6859729
-Patch0:		%{name}-config.patch
 URL:		http://www.ocsinventory-ng.org/
 BuildRequires:	perl-ExtUtils-MakeMaker
 BuildRequires:	perl-devel >= 1:5.6
@@ -77,10 +76,22 @@ komputerów, zarządzaniem licencjami, help deskiem itd.
 
 %prep
 %setup -q -n OCSNG_UNIX_SERVER-%{version}
-%patch0 -p1
 
-# undos the source
-find '(' -name '*.php' -o -name '*.inc' -o  -name '*.conf' -o  -name '*.htc' -o  -name '*.js' -o  -name '*.dtd' -o  -name '*.pm' -o  -name '*.css' ')' -print0 | xargs -0 sed -i -e 's,\r$,,'
+# mimic setup.sh
+sed -e 's,PATH_TO_LOG_DIRECTORY,/var/log/ocs-inventory-ng,g' \
+    -i etc/logrotate.d/ocsinventory-server
+
+sed -e 's,VERSION_MP,2,g' \
+    -e 's,DATABASE_SERVER,localhost,g' \
+    -e 's,DATABASE_PORT,3306,g' \
+    -e 's,PATH_TO_LOG_DIRECTORY,/var/log/ocs-inventory-ng/,g' \
+    -i etc/ocsinventory/ocsinventory-server.conf
+
+sed -e 's,OCSREPORTS_ALIAS,/ocsreports,g' \
+    -e 's,PATH_TO_OCSREPORTS_DIR,/usr/share/ocs-inventory-ng,g' \
+    -e 's,PACKAGES_ALIAS,/download,g' \
+    -e 's,PATH_TO_PACKAGES_DIR,/var/lib/ocs-inventory-ng/,g' \
+    -i etc/ocsinventory/ocsinventory-reports.conf
 
 %build
 cd Apache
diff --git a/ocs-inventory-ng-config.patch b/ocs-inventory-ng-config.patch
deleted file mode 100644
index 60035a0..0000000
--- a/ocs-inventory-ng-config.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- OCSNG_UNIX_SERVER-2.0.5/etc/logrotate.d/ocsinventory-server~	2012-04-01 16:05:55.000000000 +0200
-+++ OCSNG_UNIX_SERVER-2.0.5/etc/logrotate.d/ocsinventory-server	2013-02-22 18:53:25.250736649 +0100
-@@ -1,6 +1,7 @@
- # Rotate OCS Inventory NG Communication server logs daily
- # Save 7 days old logs in compressed mode
--PATH_TO_LOG_DIRECTORY/*.log {
-+/var/log/ocs-inventory-ng/*.log {
-+	create 660 root http
- 	daily
- 	rotate 7
- 	compress
---- OCSNG_UNIX_SERVER-2.0.5/etc/ocsinventory/ocsinventory-server.conf~	2012-04-01 16:05:55.000000000 +0200
-+++ OCSNG_UNIX_SERVER-2.0.5/etc/ocsinventory/ocsinventory-server.conf	2013-02-22 18:57:27.845324225 +0100
-@@ -15,13 +15,13 @@
-   # Which version of mod_perl we are using
-   # For mod_perl <= 1.999_21, replace VERSION_MP by 1
-   # For mod_perl > 1.999_21, replace VERSION_MP by 2
--  PerlSetEnv OCS_MODPERL_VERSION VERSION_MP
-+  PerlSetEnv OCS_MODPERL_VERSION 2
- 
-   # Master Database settings
-   # Replace DATABASE_SERVER by hostname or ip of MySQL server for WRITE
--  PerlSetEnv OCS_DB_HOST DATABASE_SERVER
-+  PerlSetEnv OCS_DB_HOST localhost
-   # Replace DATABASE_PORT by port where running MySQL server, generally 3306
--  PerlSetEnv OCS_DB_PORT DATABASE_PORT
-+  PerlSetEnv OCS_DB_PORT 3306
-   # Name of database
-   PerlSetEnv OCS_DB_NAME ocsweb
-   PerlSetEnv OCS_DB_LOCAL ocsweb
-@@ -44,7 +44,7 @@
-   # PerlSetVar OCS_DB_SL_PWD ocs
-   
-   # Path to log directory (must be writeable)
--  PerlSetEnv OCS_OPT_LOGPATH "PATH_TO_LOG_DIRECTORY"
-+  PerlSetEnv OCS_OPT_LOGPATH "/var/log/ocs-inventory-ng/"
-   
-   # If you need to specify a mysql socket that the client's built-in
-   #PerlSetEnv OCS_OPT_DBI_MYSQL_SOCKET "path/to/mysql/unix/socket"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ocs-inventory-ng.git/commitdiff/a520d0730948897c8daebba285b3fa57ada940f9



More information about the pld-cvs-commit mailing list