From 39593f9777350596344de4f0d6e4c5e53ea8b556 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 29 2014 07:54:23 +0000 Subject: import scl-utils-20130529-9.el7_0 --- diff --git a/SOURCES/0005-Various-fixes-in-Provides-and-Requires-of-scl-packag.patch b/SOURCES/0005-Various-fixes-in-Provides-and-Requires-of-scl-packag.patch new file mode 100644 index 0000000..11e173b --- /dev/null +++ b/SOURCES/0005-Various-fixes-in-Provides-and-Requires-of-scl-packag.patch @@ -0,0 +1,81 @@ +From b603a0b745fe01b410bb826422ad48b1df9d1da9 Mon Sep 17 00:00:00 2001 +From: Jan Zeleny +Date: Mon, 27 Jan 2014 10:23:36 +0100 +Subject: [PATCH] Various fixes in Provides and Requires of scl packages + +- add new Requires: %scl_runtime, to all scl packages + (every scl package requires the runtime to be installed anyway) +- add new Provides: scl-package(%scl) for metapackage and build subpackage +- exclude both from the main metapackage +- move the _root_path conditional in macros.scl: when BuildArch is + specified in spec file, rpm recursively parses spec file again. That's + the reason why the conditional is there. However, when the wrong + pieces of code are included in in, it brings some problems. This + change keep only the path definition inside the conditional, the rest + can be easily redefined again. +--- + macros.scl | 8 ++++++-- + scl.attr | 3 ++- + scldeps.sh | 3 +++ + 3 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/macros.scl b/macros.scl +index 8b6377ee00fd26c89db1748c96e703e30214e9d9..d344b5e80f4fa6d97c7243df2f40847303eb26df 100644 +--- a/macros.scl ++++ b/macros.scl +@@ -40,6 +40,7 @@ + %global _mandir %{_datadir}/man + %global _docdir %{_datadir}/doc + %global _defaultdocdir %{_docdir} ++} + %global scl_pkg_name %{scl}-%{pkg_name} + %global __os_install_post %{expand: + /usr/lib/rpm/brp-scl-compress %{_scl_root} +@@ -58,6 +59,7 @@ + Summary: Debug information for package %{name} + Group: Development/Debug + AutoReqProv: 0 ++Requires: %scl_runtime + Provides: scl-package(%scl) + %description debuginfo + This package provides debug information for package %{name}. +@@ -68,10 +70,12 @@ package or when debugging this package. + %endif + %{nil}} + BuildRequires: scl-utils-build +-} ++%if "%{?scl}%{!?scl:0}" == "%{pkg_name}" ++Requires: %{scl_runtime} ++Provides: scl-package(%{scl}) ++%endif + %{?scl_package_override:%scl_package_override} + } + + %scl_require() %{_scl_prefix}/%1/enable, %1 + %scl_require_package() %1-%2 +- +diff --git a/scl.attr b/scl.attr +index 3e546568261b996e065be3bfaed648d785466c36..068fc4a995443340428fd75b017affed069188d3 100644 +--- a/scl.attr ++++ b/scl.attr +@@ -1,2 +1,3 @@ + %__scl_provides %{_rpmconfigdir}/scldeps.sh --provides %{scl} +-%__scl_path %{?scl:^%{_scl_prefix}/.*$} ++%__scl_requires %{_rpmconfigdir}/scldeps.sh --requires %{scl_runtime} ++%__scl_path %{?scl:^%{_scl_prefix}/.*$ || %{_root_sysconfdir}/rpm/macros.%{scl}-config$} +diff --git a/scldeps.sh b/scldeps.sh +index 268d6bb5109f34d0e8da8c7d01816dcecffb6888..df8ddb3bb35b291de839bff0754c479958704030 100755 +--- a/scldeps.sh ++++ b/scldeps.sh +@@ -9,5 +9,8 @@ case $1 in + -P|--provides) + echo -n "scl-package($2)" + ;; ++-R|--requires) ++ echo -n "$2" ++ ;; + esac + exit 0 +-- +1.9.3 + diff --git a/SOURCES/0006-Modified-the-behavior-of-debuginfo-generation-proces.patch b/SOURCES/0006-Modified-the-behavior-of-debuginfo-generation-proces.patch new file mode 100644 index 0000000..3e5f733 --- /dev/null +++ b/SOURCES/0006-Modified-the-behavior-of-debuginfo-generation-proces.patch @@ -0,0 +1,92 @@ +From a2aefc2276e124b1c329a722ed43cf7fcf7f473f Mon Sep 17 00:00:00 2001 +From: Jan Zeleny +Date: Wed, 30 Jul 2014 10:00:26 +0200 +Subject: [PATCH] Modified the behavior of debuginfo generation process + +* add correct dependencies to debuginfo packages. +* add conditional definition of __debug_package macro + (allow turning debuginfor packages off) +* remove automatic creation of debuginfo for metapackage +--- + macros.scl | 51 ++++++++++++++++++++++++++++++++++----------------- + 1 file changed, 34 insertions(+), 17 deletions(-) + +diff --git a/macros.scl b/macros.scl +index d344b5e80f4fa6d97c7243df2f40847303eb26df..db85a5002f831e5e319152db8eba6e9e92efec82 100644 +--- a/macros.scl ++++ b/macros.scl +@@ -3,6 +3,39 @@ + # Copyright (C) 2012 Red Hat, Inc. + # Written by Jindrich Novy . + ++%scl_debug() %{expand: ++%define old_debug %{lua:print(rpm.expand("%{debug_package}"):len())} ++%global debug_package %{expand: ++%if "%{?old_debug}" == "0" ++ %{expand: %{nil}} ++%else ++%if "%{?scl}%{!?scl:0}" == "%{pkg_name}" ++ %{expand: %{nil}} ++%else ++%ifnarch noarch ++%package debuginfo ++Summary: Debug information for package %{name} ++Group: Development/Debug ++AutoReqProv: 0 ++Requires: %scl_runtime ++Provides: scl-package(%scl) ++%{lua: ++ debuginfo=tonumber(rpm.expand("%{old_debug}")) ++ if debuginfo > 0 then ++ rpm.define("__debug_package 1") ++ end ++} ++%description debuginfo ++This package provides debug information for package %{name}. ++Debug information is useful when developing applications that use this ++package or when debugging this package. ++%files debuginfo -f debugfiles.list ++%defattr(-,root,root) ++%endif ++%endif ++%endif ++%{nil}}} ++ + %scl_package() %{expand:%{!?_root_prefix: + %global pkg_name %1 + %global scl_name %{scl} +@@ -42,6 +75,7 @@ + %global _defaultdocdir %{_docdir} + } + %global scl_pkg_name %{scl}-%{pkg_name} ++%scl_debug + %global __os_install_post %{expand: + /usr/lib/rpm/brp-scl-compress %{_scl_root} + %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip %{__strip} +@@ -52,23 +86,6 @@ + /usr/lib/rpm/redhat/brp-python-hardlink + %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} + %{nil}} +-%global debug_package %{expand: +-%ifnarch noarch +-%global __debug_package 1 +-%package debuginfo +-Summary: Debug information for package %{name} +-Group: Development/Debug +-AutoReqProv: 0 +-Requires: %scl_runtime +-Provides: scl-package(%scl) +-%description debuginfo +-This package provides debug information for package %{name}. +-Debug information is useful when developing applications that use this +-package or when debugging this package. +-%files debuginfo -f debugfiles.list +-%defattr(-,root,root) +-%endif +-%{nil}} + BuildRequires: scl-utils-build + %if "%{?scl}%{!?scl:0}" == "%{pkg_name}" + Requires: %{scl_runtime} +-- +1.9.3 + diff --git a/SOURCES/0007-Changed-command-description-in-scl-man-pages.patch b/SOURCES/0007-Changed-command-description-in-scl-man-pages.patch new file mode 100644 index 0000000..0d6fa68 --- /dev/null +++ b/SOURCES/0007-Changed-command-description-in-scl-man-pages.patch @@ -0,0 +1,30 @@ +From ff24defdb7ff7e0460785202933ac024f273c82f Mon Sep 17 00:00:00 2001 +From: Albert Uchytil +Date: Tue, 8 Apr 2014 14:22:29 +0200 +Subject: [PATCH] Changed description in scl man pages + +--- + scl.1 | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/scl.1 b/scl.1 +index cbefc44a7d539370065912021a62a39844a51f80..51f32e4db0f18ca6a97231ad641f78ae88806e13 100644 +--- a/scl.1 ++++ b/scl.1 +@@ -25,9 +25,10 @@ to update search paths, etc. + One can enable more Software Collections if needed and therefore one can use multiple + collections which are enabled by the left-right order as present on \fBscl\fP command-line. + .PP +-\fI\fR is an arbitrary command or set of commands to execute within the Software +-Collection environment enabled. Control is returned back to the caller with the original +-environment as soon as the command finishes. If \fI\fR is '-' (dash) then it is ++\fI\fR marks specified Software Collections as enabled. Executes the script, ++which is expected to set proper environment. Executes the \fI\fR. ++Control is returned back to the caller with the original environment as soon ++as the command finishes. If \fI\fR is '-' (dash) then it is + read from the standard input. + .PP + Note: if you use \fI\fR consisting of multiple arguments, you either need to +-- +1.9.0 + diff --git a/SOURCES/0008-Changed-script-paths-in-__os_install_post.patch b/SOURCES/0008-Changed-script-paths-in-__os_install_post.patch new file mode 100644 index 0000000..69cd5f9 --- /dev/null +++ b/SOURCES/0008-Changed-script-paths-in-__os_install_post.patch @@ -0,0 +1,34 @@ +From 295ae5cb8198ea6dc45fc176ba9b2ee649997f2d Mon Sep 17 00:00:00 2001 +From: Jan Zeleny +Date: Wed, 30 Jul 2014 10:05:56 +0200 +Subject: [PATCH] Changed script paths in __os_install_post + +Required to keep up with rpm and the current system layout +--- + macros.scl | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/macros.scl b/macros.scl +index 56d85c9ed7af098e138704a5267beaf86d8f76ba..d888e01a22acc2b2cb8ea56ebeae6814f4ffa721 100644 +--- a/macros.scl ++++ b/macros.scl +@@ -78,12 +78,12 @@ package or when debugging this package. + %scl_debug + %global __os_install_post %{expand: + /usr/lib/rpm/brp-scl-compress %{_scl_root} +- %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip %{__strip} +- /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} ++ %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip} ++ /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} + } +- /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} ++ /usr/lib/rpm/brp-strip-static-archive %{__strip} + /usr/lib/rpm/brp-scl-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build} %{_scl_root} +- /usr/lib/rpm/redhat/brp-python-hardlink ++ /usr/lib/rpm/brp-python-hardlink + %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} + %{nil}} + BuildRequires: scl-utils-build +-- +1.9.3 + diff --git a/SOURCES/0009-Remove-sclbuild-as-it-s-not-that-useful.patch b/SOURCES/0009-Remove-sclbuild-as-it-s-not-that-useful.patch new file mode 100644 index 0000000..cb68ec4 --- /dev/null +++ b/SOURCES/0009-Remove-sclbuild-as-it-s-not-that-useful.patch @@ -0,0 +1,58 @@ +From fdf5b1e5582acae15d485a4c2e2af2ff2819a8c6 Mon Sep 17 00:00:00 2001 +From: Jan Zeleny +Date: Tue, 29 Jul 2014 15:36:16 +0200 +Subject: [PATCH] Remove sclbuild, as it's not that useful + +--- + Makefile | 5 ++--- + sclbuild | 8 -------- + 2 files changed, 2 insertions(+), 11 deletions(-) + delete mode 100755 sclbuild + +diff --git a/Makefile b/Makefile +index f050285c1ca85537f30bcfc7bf2cd0a38dd75821..a2d368926638c13ba3b230f02f17e27229046445 100644 +--- a/Makefile ++++ b/Makefile +@@ -3,7 +3,7 @@ VERSION=`date +%Y%m%d` + WARNINGS?=-Wall -Wshadow -Wcast-align -Winline -Wextra -Wmissing-noreturn + CFLAGS?=-O2 + CFILES=scl.c +-OTHERFILES=Makefile scl_enabled macros.scl scl.1 scldeps.sh scl.attr brp-scl-compress brp-scl-python-bytecompile scl.bash sclbuild ++OTHERFILES=Makefile scl_enabled macros.scl scl.1 scldeps.sh scl.attr brp-scl-compress brp-scl-python-bytecompile scl.bash + SOURCES=$(CFILES) $(OTHERFILES) + + BINDIR?=/usr/bin +@@ -37,7 +37,6 @@ install: all + mkdir -p $(DESTDIR)/$(RPMCONFDIR)/fileattrs + cp macros.scl $(DESTDIR)/$(CNFDIR)/rpm + cp scl $(DESTDIR)/$(BINDIR) +- cp sclbuild $(DESTDIR)/$(BINDIR) + cp scl_enabled $(DESTDIR)/$(BINDIR) + cp scl.1 $(DESTDIR)/$(MANDIR)/man1 + cp scl.attr $(DESTDIR)/$(RPMCONFDIR)/fileattrs +@@ -47,7 +46,7 @@ install: all + cp scl.bash $(DESTDIR)/$(CNFDIR)/bash_completion.d + + uninstall: +- rm -f $(BINDIR)/scl $(BINDIR)/scl_enabled $(BINDIR)/sclbuild ++ rm -f $(BINDIR)/scl $(BINDIR)/scl_enabled + rm -f $(CNFDIR)/rpm/macros.scl + rm -f $(MANDIR)/man1/scl.1 + rm -f $(RPMCONFDIR)/fileattrs/scl.attr +diff --git a/sclbuild b/sclbuild +deleted file mode 100755 +index 183d8e8d8fbcd8140052cf9b381ae73bc9f633c1..0000000000000000000000000000000000000000 +--- a/sclbuild ++++ /dev/null +@@ -1,8 +0,0 @@ +-#!/bin/sh +-if [ $# -le 1 ]; then +- echo "$0 " +-else +- SCL=$1 +- shift +- rpmbuild $@ --define "scl $SCL" +-fi +-- +1.9.3 + diff --git a/SOURCES/0010-Added-capability-to-register-and-deregister-collecti.patch b/SOURCES/0010-Added-capability-to-register-and-deregister-collecti.patch new file mode 100644 index 0000000..2035320 --- /dev/null +++ b/SOURCES/0010-Added-capability-to-register-and-deregister-collecti.patch @@ -0,0 +1,601 @@ +From 9c93f0540b2afe736a8633c0ac8ac6e4e425726d Mon Sep 17 00:00:00 2001 +From: Jan Zeleny +Date: Wed, 30 Jul 2014 09:03:35 +0200 +Subject: [PATCH] Added capability to register and deregister collections + +- scl register creates record for the collection in the scl + conf dir +- scl deregister removes the collection record from the + scl conf dir +--- + scl.1 | 18 +++ + scl.bash | 11 +- + scl.c | 427 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- + 3 files changed, 427 insertions(+), 29 deletions(-) + +diff --git a/scl.1 b/scl.1 +index 9e13778..c9c2abe 100644 +--- a/scl.1 ++++ b/scl.1 +@@ -8,6 +8,10 @@ scl \- Setup and run software from Software Collection environment + \fBscl\fP \fI\fR \fI\fR [\fI ...\fR] -- \fI\fR + .PP + \fBscl\fP {\fB-l|--list\fP} [\fI ...\fR] ++.PP ++\fBscl register\fP \fI\f ++.PP ++\fBscl deregister\fP \fI\fR [\fB--force\fP] + .SH "DESCRIPTION" + .PP + This manual page documents \fBscl\fP, a +@@ -46,6 +50,14 @@ details may be found in the documentation of the particular collection. + Lists all installed Software Collections on the system. + .IP "\fB-l, --list\fP \fI ...\fR" + If a collection name is specified then list of installed packages belonging to the collection is listed. ++.IP "\fBregister\fP \fI\fR" ++If \fI\fR leads to valid SCL file structure, \fBscl\fP will register that as a SCL. ++\fI\fR directory needs to contain \fBenable\fR scriptlet and \fBroot\fP directory, ++to be considered valid SCL. ++ needs to be an absolute path to the collection location. ++.IP "\fBderegister\fP \fI\fR [\fB--force\fP]" ++\fI\fR will no longer be considered SCL. ++If the \fI\fR was installed locally, then the use of \fB--force\fP is needed.i + .SH "EXAMPLES" + .TP + scl enable example 'less --version' +@@ -63,6 +75,12 @@ list all installed collections + .TP + scl -l example + list all packages within example collection ++scl register /foo/bar ++registers new collection with a name bar ++.TP ++scl deregister bar --force ++forces the deregistration of collection bar ++.TP + .SH "AUTHOR" + .PP + \fBscl\fP was written by Jindrich Novy and Jan Zeleny +diff --git a/scl.bash b/scl.bash +index 7f77233..5fae09a 100644 +--- a/scl.bash ++++ b/scl.bash +@@ -14,17 +14,18 @@ _scl() + return 0 + fi + ++ local collections=($(find /etc/scl/prefixes -maxdepth 1 -mindepth 1 -type f -exec basename {} \; | sort -u)) ++ + # handle scriptlets; the first parameter must be a scriptlet if it is not an option + if ((COMP_CWORD == 1)); then + # get array of scriptlets found throughout collections +- local collections=($(find /etc/scl/prefixes -maxdepth 1 -mindepth 1 -type f -exec basename {} \; | sort -u)) + local scriptlets=() + for col in ${collections[@]}; do + local prefix=`cat /etc/scl/prefixes/$col` + scriptlets+=($(find $prefix/$col/* -maxdepth 1 -type f -exec basename {} \; | sort -u)) + done + scriptlets_str=`echo ${scriptlets[@]} | sed 's/ /\n/g'| sort -u` +- COMPREPLY=( $(compgen -W "$scriptlets_str" -- ${cur}) ) ++ COMPREPLY=( $(compgen -W "$scriptlets_str register deregister" -- ${cur}) ) + return 0 + fi + +@@ -35,7 +36,11 @@ _scl() + fi + + # handle collections; if it is not an option or a command, it must be a collection +- local collections=($(find /etc/scl/prefixes -maxdepth 1 -mindepth 1 -type f -exec basename {} \; | sort -u)) ++ if [ $prev == "register" ]; then ++ compopt -o nospace ++ COMPREPLY=( $(compgen -A directory ${cur}) ) ++ return 0 ++ fi + COMPREPLY=( $(compgen -W "${collections[*]}" -- ${cur}) ) + return 0 + } +diff --git a/scl.c b/scl.c +index fcdebcb..f8e2ed4 100644 +--- a/scl.c ++++ b/scl.c +@@ -22,8 +22,10 @@ + #include + #include + #include ++#include + #include + #include ++#include + #include + #include + #include +@@ -56,6 +58,8 @@ static void write_script( int tfd, char *s ) { + static void print_usage( const char *name ) { + fprintf(stderr, "usage: %s [...] \n", name); + fprintf(stderr, " or: %s -l|--list [...]\n", name); ++ fprintf(stderr, " or: %s register \n", name); ++ fprintf(stderr, " or: %s deregister [--force]\n", name); + + fprintf(stderr, "\nOptions:\n" + " -l, --list list installed Software Collections or packages\n" +@@ -68,32 +72,121 @@ static void print_usage( const char *name ) { + "\nUse '-' as to read the command from standard input.\n"); + } + ++static int check_directory(const char *dir_name, struct stat *sb, int *count, struct dirent ***nl) { ++ if (stat(dir_name, sb) == -1) { ++ fprintf(stderr, "%s does not exist\n", dir_name); ++ return EXIT_FAILURE; ++ } ++ ++ if (!S_ISDIR(sb->st_mode)) { ++ fprintf(stderr, "%s is not a directory\n", dir_name); ++ return EXIT_FAILURE; ++ } ++ ++ if ((*count = scandir(dir_name, nl, 0, alphasort)) < 0) { ++ perror("scandir"); ++ fprintf(stderr, "%s\n", dir_name); ++ return EXIT_FAILURE; ++ } ++ return EXIT_SUCCESS; ++} ++ ++static int get_collection_dir_path(char *col_name, char **_col_dir) { ++ int i; ++ int fd = -1; ++ char *file_path = NULL; ++ char *col_dir = NULL; ++ struct stat st; ++ int ret = EXIT_FAILURE; ++ int col_name_len = strlen(col_name); ++ int col_dir_len; ++ ++ file_path = (char *)malloc(sizeof(SCL_CONF_DIR) + col_name_len + 1); ++ if (file_path == NULL) { ++ fprintf(stderr, "Can't allocate memory.\n"); ++ return EXIT_FAILURE; ++ } ++ sprintf(file_path, "%s%s", SCL_CONF_DIR, col_name); ++ ++ if (stat(file_path, &st) != 0) { ++ perror("Unable to get file status"); ++ fprintf(stderr, "%s\n", file_path); ++ goto done; ++ } ++ ++ fd = open(file_path, O_RDONLY); ++ if (fd < 0) { ++ perror("Unable to open file"); ++ fprintf(stderr, "%s\n", file_path); ++ goto done; ++ } ++ ++ /* One for slash, one for terminating zero*/ ++ col_dir = (char *)calloc(st.st_size + col_name_len + 2, 1); ++ if (col_dir == NULL) { ++ fprintf(stderr, "Can't allocate memory.\n"); ++ goto done; ++ } ++ if ((col_dir_len = read(fd, col_dir, st.st_size)) < 0) { ++ fprintf(stderr, "Unable to read from file.\n"); ++ goto done; ++ } ++ for (i = col_dir_len-1; i > 0; i--) { ++ if (isspace(col_dir[i]) || col_dir[i] == '/') { ++ col_dir[i] = '\0'; ++ } else { ++ break; ++ } ++ } ++ col_dir[i+1] = '/'; ++ memcpy(col_dir + i + 2, col_name, col_name_len + 1); ++ ++ *_col_dir = col_dir; ++ ++ ret = EXIT_SUCCESS; ++done: ++ if (fd > 0) { ++ close(fd); ++ } ++ if (ret != EXIT_SUCCESS) { ++ free(col_dir); ++ } ++ free(file_path); ++ return ret; ++} ++ ++static int col_available(char *col_name) { ++ char *col_dir = NULL; ++ int ret = 0; ++ ++ if (get_collection_dir_path(col_name, &col_dir)) { ++ return EXIT_FAILURE; ++ } ++ ret = access(col_dir, F_OK); ++ free(col_dir); ++ return ret; ++} ++ + static void list_collections() { + struct stat sb; + struct dirent **nl; + int n, i; + +- if (stat(SCL_CONF_DIR, &sb) == -1) { +- fprintf(stderr, "%s does not exist\n", SCL_CONF_DIR); +- exit(EXIT_FAILURE); +- } +- +- if (!S_ISDIR(sb.st_mode)) { +- fprintf(stderr, "%s is not a directory\n", SCL_CONF_DIR); +- exit(EXIT_FAILURE); +- } +- +- if ((n = scandir(SCL_CONF_DIR, &nl, 0, alphasort)) < 0) { +- perror("scandir"); ++ if (check_directory(SCL_CONF_DIR, &sb, &n, &nl)) { + exit(EXIT_FAILURE); + } + + for (i=0; id_name != '.') { +- printf("%s\n", nl[i]->d_name); ++ if (col_available(nl[i]->d_name) == 0) { ++ printf("%s\n", nl[i]->d_name); ++ } + } + } + ++ for (i = 0; i < n; i++) { ++ free(nl[i]); ++ } + free(nl); + } + +@@ -157,7 +250,7 @@ static char **read_script_output( char *ori_cmd ) { + return lines; + } + +-static int list_packages_in_collection( const char *colname) { ++static int list_packages_in_collection(const char *colname) { + struct stat sb; + struct dirent **nl; + int i, n, found, smax, ss; +@@ -165,18 +258,7 @@ static int list_packages_in_collection( const char *colname) { + char **srpms = NULL; + size_t cns; + +- if (stat(SCL_CONF_DIR, &sb) == -1) { +- fprintf(stderr, "%s does not exist\n", SCL_CONF_DIR); +- exit(EXIT_FAILURE); +- } +- +- if (!S_ISDIR(sb.st_mode)) { +- fprintf(stderr, "%s is not a directory\n", SCL_CONF_DIR); +- exit(EXIT_FAILURE); +- } +- +- if ((n = scandir(SCL_CONF_DIR, &nl, 0, alphasort)) < 0) { +- perror("scandir"); ++ if (check_directory(SCL_CONF_DIR, &sb, &n, &nl)) { + exit(EXIT_FAILURE); + } + +@@ -246,6 +328,260 @@ static int list_packages_in_collection( const char *colname) { + return 0; + } + ++static int split_path(char *col_path, char **_col, char **_fname) { ++ char *name_start = NULL; ++ char *name_end = NULL; ++ char *col = NULL; ++ int col_path_len = strlen(col_path); ++ ++ col = (char *)malloc(strlen(col_path) + 1); ++ if (col == NULL) { ++ fprintf(stderr, "Can't allocate memory.\n"); ++ return EXIT_FAILURE; ++ } ++ memcpy(col, col_path, col_path_len + 1); ++ ++ name_end = col + col_path_len - 1; ++ while (name_end > col && *name_end == '/') { ++ *name_end = '\0'; ++ name_end--; ++ } ++ ++ name_start = strrchr(col, '/'); ++ if (name_start == NULL) { ++ free(col); ++ return EXIT_FAILURE; ++ } else { ++ *name_start = '\0'; ++ name_start++; ++ } ++ ++ *_fname = name_start; ++ *_col = col; ++ return EXIT_SUCCESS; ++} ++ ++static int get_collection_conf_path(char *col_name, char **_col_path) { ++ char *col_path = (char *)malloc(sizeof(SCL_CONF_DIR) + strlen(col_name) + 1); ++ if (col_path == NULL) { ++ fprintf(stderr, "Can't allocate memory.\n"); ++ return EXIT_FAILURE; ++ } ++ sprintf(col_path, "%s%s", SCL_CONF_DIR, col_name); ++ *_col_path = col_path; ++ return EXIT_SUCCESS; ++} ++ ++static int check_valid_collection(char *col_dir) { ++ struct stat sb; ++ struct dirent **nl; ++ int n, i; ++ bool missing_root = true; ++ bool missing_enable = true; ++ ++ if (check_directory(col_dir, &sb, &n, &nl)) { ++ exit(EXIT_FAILURE); ++ } ++ ++ for (i=0; id_name != '.') { ++ if (!strcmp(nl[i]->d_name, "root")) { ++ missing_root = false; ++ } else if (!strcmp(nl[i]->d_name, "enable")) { ++ missing_enable = false; ++ } ++ } ++ free(nl[i]); ++ } ++ free(nl); ++ ++ return missing_root || missing_enable; ++} ++ ++static int run_script(char *script_path, char *script_name) { ++ char *script = NULL; ++ char *cmd = NULL; ++ int status; ++ int ret = EXIT_FAILURE; ++ ++ if (script_path[strlen(script_path) - 1] == '/') { ++ check_asprintf(&script, "%s%s", script_path, script_name); ++ } else { ++ check_asprintf(&script, "%s/%s", script_path, script_name); ++ } ++ ++ if (!access(script, F_OK)) { ++ check_asprintf(&cmd, "/bin/bash %s", script); ++ status = system(cmd); ++ if (status == -1) { ++ perror("Unable to execute script\n"); ++ fprintf(stderr, "%s\n", script); ++ goto done; ++ } ++ if (!WIFEXITED(status)) { ++ fprintf(stderr, "Script %s didn't terminate normally\n", script); ++ goto done; ++ } ++ if (WEXITSTATUS(status)) { ++ fprintf(stderr, "Script %s returned nonzero return code\n", script); ++ goto done; ++ } ++ } ++ ++ ret = EXIT_SUCCESS; ++ ++done: ++ free(script); ++ free(cmd); ++ return ret; ++} ++ ++static int register_collection(char *col_path) { ++ FILE *f; ++ char *col = NULL; ++ char *name = NULL; ++ char *new_file = NULL; ++ ++ if (col_path == NULL || col_path[0] != '/') { ++ fprintf(stderr, "Collection must be specified as an absolute path!\n"); ++ return EXIT_FAILURE; ++ } ++ ++ if (access(col_path, F_OK)) { ++ perror("Directory doesn't exist"); ++ fprintf(stderr, "%s\n", col_path); ++ return EXIT_FAILURE; ++ } ++ ++ if (check_valid_collection(col_path)) { ++ fprintf(stderr, "Unable to register collection: %s is not a valid collection\n", col_path); ++ return EXIT_FAILURE; ++ } ++ ++ if (split_path(col_path, &col, &name)) { ++ return EXIT_FAILURE; ++ } ++ ++ if (get_collection_conf_path(name, &new_file)) { ++ free(col); ++ return EXIT_FAILURE; ++ } ++ ++ if (access(new_file, F_OK) == 0) { ++ fprintf(stderr, "Unable to register collection: Collection with the same name is already registered\n"); ++ free(new_file); ++ free(col); ++ return EXIT_FAILURE; ++ } ++ ++ f = fopen(new_file, "w+"); ++ if (f == NULL) { ++ perror("Unable to open file"); ++ fprintf(stderr, "%s\n", new_file); ++ free(col); ++ free(new_file); ++ return EXIT_FAILURE; ++ } ++ ++ fprintf(f, "%s\n", col); ++ fclose(f); ++ ++ if (run_script(col_path, "register")) { ++ fprintf(stderr, "Execution of register script failed\n"); ++ if (unlink(new_file)) { ++ perror("Unable to remove file: "); ++ fprintf(stderr, "%s\n", new_file); ++ fprintf(stderr, "Remove this file manually before a new try to register collection!\n"); ++ } ++ free(new_file); ++ free(col); ++ return EXIT_FAILURE; ++ } ++ ++ printf("Collection succesfully registered.\n" ++ "The collection can now be enabled using 'scl enable %s '\n", name); ++ free(new_file); ++ free(col); ++ ++ return EXIT_SUCCESS; ++} ++ ++static int check_package(char *file_path, int *_status) { ++ char *cmd = NULL; ++ int path_len = strlen(file_path); ++ char rpm_query[] = "rpm -qf %s > /dev/null 2> /dev/null"; ++ ++ cmd = (char *)malloc(path_len + sizeof(rpm_query) - 1); ++ if (cmd == NULL) { ++ fprintf(stderr, "Can't allocate memory.\n"); ++ return EXIT_FAILURE; ++ } ++ sprintf(cmd, rpm_query, file_path); ++ *_status = system(cmd); ++ free(cmd); ++ ++ return EXIT_SUCCESS; ++} ++ ++static int deregister_collection(char *col_path, bool force) { ++ char *col = NULL; ++ char *col_name = NULL; ++ char *col_dir = NULL; ++ ++ if (get_collection_conf_path(col_path, &col_name)) { ++ free(col); ++ return EXIT_FAILURE; ++ } ++ ++ if (!force) { ++ int status; ++ if (check_package(col_name, &status)) { ++ free(col_name); ++ free(col); ++ return EXIT_FAILURE; ++ } ++ ++ if (status == 0) { ++ fprintf(stderr, "Unable to deregister collection: " ++ "Collection was installed as a package, please use --force to deregister it.\n"); ++ free(col); ++ free(col_name); ++ return EXIT_FAILURE; ++ } ++ } ++ ++ if (get_collection_dir_path(col_path, &col_dir)) { ++ free(col_name); ++ free(col); ++ return EXIT_FAILURE; ++ } ++ ++ if (run_script(col_dir, "deregister")) { ++ fprintf(stderr, "Execution of deregister script failed\n"); ++ free(col_dir); ++ free(col_name); ++ free(col); ++ return EXIT_FAILURE; ++ } ++ ++ if (remove(col_name)) { ++ perror("Unable to delete file"); ++ fprintf(stderr, "%s\n", col_name); ++ free(col_dir); ++ free(col_name); ++ free(col); ++ return EXIT_FAILURE; ++ } ++ printf("Collection successfully deregistered.\n"); ++ free(col_dir); ++ free(col_name); ++ free(col); ++ return EXIT_SUCCESS; ++} ++ ++ ++ ++ + int main(int argc, char **argv) { + struct stat st; + char *path, *enablepath; +@@ -254,6 +590,7 @@ int main(int argc, char **argv) { + int i, tfd, ffd; + int separator_pos = 0; + char *command = NULL; ++ int failed = 0; + + if (argc == 2 && (!strcmp(argv[1],"--help") || !strcmp(argv[1],"-h"))) { + print_usage(argv[0]); +@@ -270,6 +607,44 @@ int main(int argc, char **argv) { + exit(EXIT_SUCCESS); + } + ++ if (argc > 2 && (!strcmp(argv[1], "register"))) { ++ failed = 0; ++ for (i = 2; i < argc; i++) { ++ if (register_collection(argv[i]) != 0) { ++ failed++; ++ } ++ } ++ if (failed > 0) { ++ fprintf(stderr, "Registration of %d collections failed!\n", failed); ++ exit(EXIT_FAILURE); ++ } else { ++ exit(EXIT_SUCCESS); ++ } ++ } ++ if (argc > 2 && (!(strcmp(argv[1], "deregister")))) { ++ bool force = false; ++ for (i = 2; i < argc; i++) { ++ if (!strcmp(argv[i], "--force")) { ++ force = true; ++ break; ++ } ++ } ++ for (i = 2; i < argc; i++) { ++ if (strcmp(argv[i], "--force") != 0) { ++ failed = 0; ++ if (deregister_collection(argv[i], force) != 0) { ++ failed++; ++ } ++ } ++ } ++ if (failed > 0) { ++ fprintf(stderr, "Deregistration of %d collections failed!\n", failed); ++ exit(EXIT_FAILURE); ++ } else { ++ exit(EXIT_SUCCESS); ++ } ++ } ++ + for (i = 0; i < argc; i++) { + if (strcmp(argv[i], "--") == 0) { + break; +-- +1.9.3 + diff --git a/SOURCES/0011-Fix-missing-allocation-check-in-read_script_output.patch b/SOURCES/0011-Fix-missing-allocation-check-in-read_script_output.patch new file mode 100644 index 0000000..3cafb83 --- /dev/null +++ b/SOURCES/0011-Fix-missing-allocation-check-in-read_script_output.patch @@ -0,0 +1,28 @@ +From 95d287071663ef5a0025c8ee136b31c905b63ae0 Mon Sep 17 00:00:00 2001 +From: Jan Zeleny +Date: Wed, 30 Jul 2014 10:24:26 +0200 +Subject: [PATCH] Fix missing allocation check in read_script_output() + +--- + scl.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/scl.c b/scl.c +index fcdebcbfd35dec2c4ff68536bc90771d439fc044..907f368a58f6f1b4ba75ec62ad95ebb535778903 100644 +--- a/scl.c ++++ b/scl.c +@@ -217,7 +217,10 @@ static char **read_script_output( char *ori_cmd ) { + unlink(tmp); + + ls = 0x100; +- lines = malloc(ls*sizeof(char*)); ++ if ((lines = (char **)malloc(ls*sizeof(char*))) == NULL) { ++ fprintf(stderr, "Unable to allocate memory.\n"); ++ exit(EXIT_FAILURE); ++ } + *lines = NULL; + + for (mp=m; mp && mp < &m[sb.st_size];) { +-- +1.9.3 + diff --git a/SOURCES/0012-Introduce-scl_dependency_generators-macro.patch b/SOURCES/0012-Introduce-scl_dependency_generators-macro.patch new file mode 100644 index 0000000..bbe7a06 --- /dev/null +++ b/SOURCES/0012-Introduce-scl_dependency_generators-macro.patch @@ -0,0 +1,35 @@ +From d854427f573cba1f74c6e9141d31e5b2e31ca657 Mon Sep 17 00:00:00 2001 +From: Jan Zeleny +Date: Tue, 26 Aug 2014 13:44:12 +0200 +Subject: [PATCH] Introduce %scl_dependency_generators macro + +Up until now, collections with custom dependency generators used the +%scl_package_override macro. However with the rewritten dependency +dependency generators several commits back, this is no longer working, +as the dependency generators defined in %scl_package are final. This +macro can be now udes to override dependency generators in -build +subpackages on anywhere else in a way compatible with the %scl_package +definition. + +As an effect, dependency generators defined in +%scl_dependency_generators macro will be taken into account when +%generating automatic dependencies for SCLized packages. +--- + macros.scl | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/macros.scl b/macros.scl +index 1500ab566f93b750873f5ebf752a0ce5a631f2a0..67c76be732d2f8abd54dc1af4da61a2c826432cc 100644 +--- a/macros.scl ++++ b/macros.scl +@@ -74,6 +74,7 @@ package or when debugging this package. + %global _docdir %{_datadir}/doc + %global _defaultdocdir %{_docdir} + } ++%{?scl_dependency_generators:%scl_dependency_generators} + %global scl_pkg_name %{scl}-%{pkg_name} + %scl_debug + %global __os_install_post %{expand: +-- +1.9.3 + diff --git a/SOURCES/0013-Add-capability-to-share-collections-using-nfs.patch b/SOURCES/0013-Add-capability-to-share-collections-using-nfs.patch new file mode 100644 index 0000000..73e6570 --- /dev/null +++ b/SOURCES/0013-Add-capability-to-share-collections-using-nfs.patch @@ -0,0 +1,31 @@ +From 5d045f6056750460e01f0b00d9004f64a6a6e1a6 Mon Sep 17 00:00:00 2001 +From: Lubos Kardos +Date: Wed, 24 Sep 2014 10:27:47 +0200 +Subject: [PATCH] Add capability to share collections using nfs + +- Add macro nfsmountable. If this macro is defined then syconfdir and + localstatedir are moved from /opt to /etc and /var. +--- + macros.scl | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/macros.scl b/macros.scl +index 67c76be..3bf00ce 100644 +--- a/macros.scl ++++ b/macros.scl +@@ -65,8 +65,11 @@ package or when debugging this package. + %global _libexecdir %{_exec_prefix}/libexec + %global _datadir %{_prefix}/share + %global _sysconfdir %{_scl_root}/etc +-%global _sharedstatedir %{_prefix}/com ++%{?nfsmountable: %global _sysconfdir %{_root_sysconfdir}%{_scl_prefix}/scls/%{scl}} ++%global _sharedstatedir %{_scl_root}/var/lib ++%{?nfsmountable: %global _sharedstatedir %{_root_localstatedir}%{_scl_prefix}/scls/%{scl}/lib} + %global _localstatedir %{_scl_root}/var ++%{?nfsmountable: %global _localstatedir %{_root_localstatedir}%{_scl_prefix}/scls/%{scl}} + %global _libdir %{_exec_prefix}/%{_lib} + %global _includedir %{_prefix}/include + %global _infodir %{_datadir}/info +-- +1.9.3 + diff --git a/SOURCES/macros.scl-filesystem b/SOURCES/macros.scl-filesystem index 721f3d9..55e1462 100644 --- a/SOURCES/macros.scl-filesystem +++ b/SOURCES/macros.scl-filesystem @@ -8,15 +8,15 @@ %{_scl_root}/bin %attr(555,root,root) %{_scl_root}/boot %{_scl_root}/dev -%dir %{_scl_root}/etc -%{_scl_root}/etc/X11 -%{_scl_root}/etc/xdg -%{_scl_root}/etc/opt -%{_scl_root}/etc/pm -%{_scl_root}/etc/xinetd.d -%{_scl_root}/etc/skel -%{_scl_root}/etc/sysconfig -%{_scl_root}/etc/pki +%dir %{_sysconfdir} +%{_sysconfdir}/X11 +%{_sysconfdir}/xdg +%{_sysconfdir}/opt +%{_sysconfdir}/pm +%{_sysconfdir}/xinetd.d +%{_sysconfdir}/skel +%{_sysconfdir}/sysconfig +%{_sysconfdir}/pki %{_scl_root}/home %{_scl_root}/lib %ifarch x86_64 ppc ppc64 sparc sparc64 s390 s390x @@ -37,7 +37,7 @@ %{_scl_root}/usr/etc %{_scl_root}/usr/games %{_scl_root}/usr/include -%attr(555,root,root) %{_scl_root}/usr/lib +%dir %attr(555,root,root) %{_scl_root}/usr/lib %ifarch x86_64 ppc ppc64 sparc sparc64 s390 s390x %attr(555,root,root) %{_scl_root}/usr/%{_lib} %endif @@ -71,28 +71,28 @@ %{_scl_root}/usr/share/X11 %{_scl_root}/usr/src %{_scl_root}/usr/tmp -%dir %{_scl_root}/var -%{_scl_root}/var/adm -%{_scl_root}/var/cache -%{_scl_root}/var/db -%{_scl_root}/var/empty -%{_scl_root}/var/games -%{_scl_root}/var/gopher -%{_scl_root}/var/lib -%{_scl_root}/var/local -%ghost %dir %attr(755,root,root) %{_scl_root}/var/lock -%ghost %{_scl_root}/var/lock/subsys -%{_scl_root}/var/log -%{_scl_root}/var/mail -%{_scl_root}/var/nis -%{_scl_root}/var/opt -%{_scl_root}/var/preserve -%ghost %attr(755,root,root) %{_scl_root}/var/run -%dir %{_scl_root}/var/spool -%attr(755,root,root) %{_scl_root}/var/spool/lpd -%attr(775,root,mail) %{_scl_root}/var/spool/mail -%attr(1777,root,root) %{_scl_root}/var/tmp -%{_scl_root}/var/yp +%dir %{_localstatedir} +%{_localstatedir}/adm +%{_localstatedir}/cache +%{_localstatedir}/db +%{_localstatedir}/empty +%{_localstatedir}/games +%{_localstatedir}/gopher +%{_localstatedir}/lib +%{_localstatedir}/local +%ghost %dir %attr(755,root,root) %{_localstatedir}/lock +%ghost %{_localstatedir}/lock/subsys +%{_localstatedir}/log +%{_localstatedir}/mail +%{_localstatedir}/nis +%{_localstatedir}/opt +%{_localstatedir}/preserve +%ghost %attr(755,root,root) %{_localstatedir}/run +%dir %{_localstatedir}/spool +%attr(755,root,root) %{_localstatedir}/spool/lpd +%attr(775,root,mail) %{_localstatedir}/spool/mail +%attr(1777,root,root) %{_localstatedir}/tmp +%{_localstatedir}/yp } %scl_install %{expand: @@ -105,7 +105,7 @@ EOF cat >> %{buildroot}%{_root_sysconfdir}/scl/prefixes/%{scl} << EOF %_scl_prefix EOF -# filesystem +# filelist set +x cat >> %{buildroot}/lang-exceptions << EOF af_ZA @@ -261,19 +261,26 @@ cat >> %{buildroot}/iso_3166.sed << EOF } H EOF +mkdir -p %{buildroot}%{_localstatedir} +pushd %{buildroot}%{_localstatedir} +mkdir -p {adm,empty,gopher,lib/{games,misc,rpm-state},local,lock/subsys,log,nis,preserve,run,spool/{mail,lpd,uucp},tmp,db,cache,opt,games,yp} +popd +mkdir -p %{buildroot}%{_sysconfdir} +pushd %{buildroot}%{_sysconfdir} +mkdir -p {X11/{applnk,fontpath.d},xdg/autostart,opt,pm/{config.d,power.d,sleep.d},xinetd.d,skel,sysconfig,pki} +popd mkdir -p %{buildroot}%{_scl_root} +rm -f $RPM_BUILD_DIR/%{buildsubdir}/filelist rm -f $RPM_BUILD_DIR/%{buildsubdir}/filesystem pushd %{buildroot}%{_scl_root} mkdir -p boot dev \\ - etc/{X11/{applnk,fontpath.d},xdg/autostart,opt,pm/{config.d,power.d,sleep.d},xinetd.d,skel,sysconfig,pki} \\ home media mnt opt proc root run/lock srv sys tmp \\ - usr/{bin,etc,games,include,lib/{games,locale,modules,sse2},libexec,local/{bin,etc,games,lib,sbin,src,share/{applications,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x},info},libexec,include,},sbin,share/{aclocal,applications,augeas/lenses,backgrounds,desktop-directories,dict,doc,empty,games,ghostscript/conf.d,gnome,icons,idl,info,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p},mime-info,misc,omf,pixmaps,sounds,themes,xsessions,X11},src,src/kernels,src/debug} \\ - var/{adm,empty,gopher,lib/{games,misc,rpm-state},local,lock/subsys,log,nis,preserve,run,spool/{mail,lpd},tmp,db,cache,opt,games,yp} + usr/{bin,etc,games,include,lib/{games,locale,modules,sse2},libexec,local/{bin,etc,games,lib,sbin,src,share/{applications,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x},info},libexec,include,},sbin,share/{aclocal,applications,augeas/lenses,backgrounds,desktop-directories,dict,doc,empty,games,ghostscript/conf.d,gnome,icons,idl,info,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p},mime-info,misc,omf,pixmaps,sounds,themes,xsessions,X11},src,src/kernels,src/debug} %ifarch x86_64 ppc ppc64 sparc sparc64 s390 s390x mkdir -p usr/{%{_lib}/{games,sse2,tls,X11,pm-utils/{module.d,power.d,sleep.d}},local/%{_lib}} %endif -ln -snf ../var/tmp usr/tmp -ln -snf spool/mail var/mail +ln -snf %{_localstatedir}/tmp usr/tmp +ln -snf spool/mail %{buildroot}%{_localstatedir}/mail ln -snf usr/bin bin ln -snf usr/sbin sbin ln -snf usr/lib lib @@ -289,8 +296,8 @@ grep -v "^$" %{buildroot}/iso_639.tab | grep -v "^#" | while read a b c d ; do if [ "$locale" = "XX" ]; then locale=$b fi - echo "%lang(${locale}) %{_scl_root}/usr/share/locale/${locale}" >> $RPM_BUILD_DIR/%{buildsubdir}/filesystem - echo "%lang(${locale}) %ghost %config(missingok) %{_scl_root}/usr/share/man/${locale}" >> $RPM_BUILD_DIR/%{buildsubdir}/filesystem + echo "%lang(${locale}) %{_scl_root}/usr/share/locale/${locale}" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist + echo "%lang(${locale}) %ghost %config(missingok) %{_scl_root}/usr/share/man/${locale}" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist done cat %{buildroot}/lang-exceptions | grep -v "^#" | grep -v "^$" | while read loc ; do locale=$loc @@ -309,23 +316,24 @@ cat %{buildroot}/lang-exceptions | grep -v "^#" | grep -v "^$" | while read loc egrep -q "[[:space:]]${locale%%_*}[[:space:]]" \\ %{buildroot}/iso_639.tab || continue fi - echo "%lang(${locale}) %{_scl_root}/usr/share/locale/${loc}" >> $RPM_BUILD_DIR/%{buildsubdir}/filesystem - echo "%lang(${locale}) %ghost %config(missingok) %{_scl_root}/usr/share/man/${loc}" >> $RPM_BUILD_DIR/%{buildsubdir}/filesystem + echo "%lang(${locale}) %{_scl_root}/usr/share/locale/${loc}" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist + echo "%lang(${locale}) %ghost %config(missingok) %{_scl_root}/usr/share/man/${loc}" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist done rm -f %{buildroot}/iso_639.tab rm -f %{buildroot}/iso_639.sed rm -f %{buildroot}/iso_3166.tab rm -f %{buildroot}/iso_3166.sed rm -f %{buildroot}/lang-exceptions -cat $RPM_BUILD_DIR/%{buildsubdir}/filesystem | grep "locale" | while read a b ; do +cat $RPM_BUILD_DIR/%{buildsubdir}/filelist | grep "locale" | while read a b ; do mkdir -p -m 755 %{buildroot}/$b/LC_MESSAGES done -cat $RPM_BUILD_DIR/%{buildsubdir}/filesystem | grep "/share/man" | while read a b c d; do +cat $RPM_BUILD_DIR/%{buildsubdir}/filelist | grep "/share/man" | while read a b c d; do mkdir -p -m 755 %{buildroot}/$d/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p} done for i in man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p}; do - echo "%{_scl_root}/usr/share/man/$i" >> $RPM_BUILD_DIR/%{buildsubdir}/filesystem + echo "%{_scl_root}/usr/share/man/$i" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist done +ln -s $RPM_BUILD_DIR/%{buildsubdir}/filelist $RPM_BUILD_DIR/%{buildsubdir}/filesystem set -x popd } diff --git a/SPECS/scl-utils.spec b/SPECS/scl-utils.spec index 1cb7c6e..f373836 100644 --- a/SPECS/scl-utils.spec +++ b/SPECS/scl-utils.spec @@ -1,7 +1,7 @@ Summary: Utilities for alternative packaging Name: scl-utils Version: 20130529 -Release: 5%{?dist} +Release: 9%{?dist} License: GPLv2+ Group: Applications/File URL: https://fedorahosted.org/released/scl-utils/ @@ -12,6 +12,15 @@ Patch0: 0001-Rename-attr-macros-so-they-are-correctly-named.patch Patch1: 0002-Implement-as-a-command-separator.patch Patch2: 0003-Mention-environment-modifying-commands-in-the-man-pa.patch Patch3: 0004-Check-whether-a-file-was-created-when-doing-mkstemp-.patch +Patch4: 0005-Various-fixes-in-Provides-and-Requires-of-scl-packag.patch +Patch5: 0006-Modified-the-behavior-of-debuginfo-generation-proces.patch +Patch6: 0007-Changed-command-description-in-scl-man-pages.patch +Patch7: 0008-Changed-script-paths-in-__os_install_post.patch +Patch8: 0009-Remove-sclbuild-as-it-s-not-that-useful.patch +Patch9: 0010-Added-capability-to-register-and-deregister-collecti.patch +Patch10: 0011-Fix-missing-allocation-check-in-read_script_output.patch +Patch11: 0012-Introduce-scl_dependency_generators-macro.patch +Patch12: 0013-Add-capability-to-share-collections-using-nfs.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description @@ -32,6 +41,15 @@ Essential RPM build macros for alternative packaging. %patch1 -p1 -b .command-separator %patch2 -p1 -b .env-variables-man %patch3 -p1 -b .coverity-mkstemp +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 %build make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" @@ -71,7 +89,6 @@ rm -rf %buildroot %{!?_rpmconfigdir:%global _rpmconfigdir /usr/lib/rpm} %files build %defattr(-,root,root,-) -%{_bindir}/sclbuild %{_sysconfdir}/rpm/macros.scl %{_rpmconfigdir}/scldeps.sh %{_rpmconfigdir}/fileattrs/scl.attr @@ -79,6 +96,38 @@ rm -rf %buildroot %{_rpmconfigdir}/brp-scl-python-bytecompile %changelog +* Wed Oct 23 2014 Lubos Kardos - 20130529-6 +Catch up with Fedora and RHEL6 +- add automatic Provides: scl-package(%scl) to all scl packages + (except for metapackages) +- add automatic Requires: %scl_runtime to all scl packages + (except for metapackages) +- the "filesystem" file renamed back to "filelist" +- add correct dependencies to debug packages. +- allow disabling debuginfo generation +- remove automatic creation of debuginfo for metapackage. +- rephrase command description in man page +- fix system paths in __os_install_post +- remove the sclbuild utility, as it's mostly useless +- add the command set to register/deregister collection +- fix missing allocation check in read_script_output() +- drop recursive ownership of /usr/lib within SCL root +- introduce %scl_dependency_generators macro + * Fri Jan 24 2014 Daniel Mach - 20130529-5 - Mass rebuild 2014-01-24