[scl-utils] trigger scl-utils-build BR inclusion while using scl macros and remove dsc macros and aliases

Jindrich Novy jnovy at fedoraproject.org
Wed Jan 25 13:25:46 UTC 2012


commit 21970d81404b69d7bbddfbc8ae50e62ff8116497
Author: Jindrich Novy <jnovy at redhat.com>
Date:   Wed Jan 25 14:25:36 2012 +0100

    trigger scl-utils-build BR inclusion while using scl macros
    and remove dsc macros and aliases

 .gitignore     |    3 +-
 Makefile       |   16 +++----
 macros.dsc     |  131 --------------------------------------------------------
 macros.scl     |   66 ++++++++++++++++++++++++++++
 scl-utils.spec |   11 +++--
 sources        |    2 +-
 6 files changed, 81 insertions(+), 148 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index cc13e3c..4d14370 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
-/dsc
 /scl
 /scl.o
-/scl-utils-20120111.tar.gz
+/scl-utils-20120125.tar.gz
diff --git a/Makefile b/Makefile
index eebd673..3a46d61 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.dsc
+OTHERFILES=Makefile scl_enabled macros.scl
 SOURCES=$(CFILES) $(OTHERFILES)
 OBJECTS=scl.o
 
@@ -15,16 +15,14 @@ all: $(NAME)
 
 $(NAME): $(SOURCES) $(OBJECTS) $(OTHERFILES)
 	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) $(WARNINGS) -o scl
-	rm -f dsc
-	ln -s scl dsc
 
 clean:
-	rm -f *.o scl dsc
+	rm -f *.o scl
 
 distclean: clean
 	rm -f *~
 
-dist:
+dist: $(NAME)
 	LANG=C
 	rm -rf $(NAME)-$(VERSION)
 	mkdir $(NAME)-$(VERSION)
@@ -35,11 +33,11 @@ dist:
 install: $(NAME)
 	mkdir -p $(DESTDIR)/$(BINDIR)
 	mkdir -p $(DESTDIR)/$(CNFDIR)/rpm
-	cp macros.dsc $(DESTDIR)/$(CNFDIR)/rpm
+	cp macros.scl $(DESTDIR)/$(CNFDIR)/rpm
 	cp scl $(DESTDIR)/$(BINDIR)
-	cp -d dsc $(DESTDIR)/$(BINDIR)
+	cp -d scl $(DESTDIR)/$(BINDIR)
 	cp scl_enabled $(DESTDIR)/$(BINDIR)
 
 uninstall:
-	rm -f $(BINDIR)/$(NAME) $(BINDIR)/dsc
-	rm -f $(CNFDIR)/rpm/macros.dsc
+	rm -f $(BINDIR)/$(NAME) $(BINDIR)/scl
+	rm -f $(CNFDIR)/rpm/macros.scl
diff --git a/macros.scl b/macros.scl
new file mode 100644
index 0000000..cd160c3
--- /dev/null
+++ b/macros.scl
@@ -0,0 +1,66 @@
+# scl-utils RPM macros
+#
+# Copyright (C) 2012 Red Hat, Inc.
+#   Written by Jindrich Novy <jnovy at redhat.com>.
+
+%scl_package() %{expand:%{!?_root_prefix:
+%global pkg_name		%1
+%global scl_short_prefix	scl
+%global scl_name		%{scl_short_prefix}_%{scl}
+%global scl_runtime		%{scl_name}-runtime
+%global scl_prefix		%{scl_name}_
+%{!?_scl_prefix:		%global _scl_prefix /opt/rh}
+%global _scl_scripts		%{_scl_prefix}/%{scl}
+%global _scl_root		%{_scl_prefix}/%{scl}/root
+%global _root_prefix		%{_prefix}
+%global _root_exec_prefix	%{_root_prefix}
+%global _root_bindir		%{_exec_prefix}/bin
+%global _root_sbindir		%{_exec_prefix}/sbin
+%global _root_libexecdir	%{_exec_prefix}/libexec
+%global _root_datadir		%{_prefix}/share
+%global _root_sysconfdir	%{_sysconfdir}
+%global _root_sharedstatedir	%{_prefix}/com
+%global _root_localstatedir	%{_prefix}/var
+%global _root_libdir		%{_exec_prefix}/%{_lib}
+%global _root_includedir	%{_prefix}/include
+%global _root_infodir		%{_datadir}/info
+%global _root_mandir		%{_datadir}/man
+%global _root_initddir		%{_sysconfdir}/rc.d/init.d
+%global _prefix			%{_scl_root}/usr
+%global _exec_prefix		%{_prefix}
+%global _bindir			%{_exec_prefix}/bin
+%global _sbindir		%{_exec_prefix}/sbin
+%global _libexecdir		%{_exec_prefix}/libexec
+%global _datadir		%{_prefix}/share
+%global _sysconfdir		%{_scl_root}/etc
+%global _sharedstatedir		%{_prefix}/com
+%global _localstatedir		%{_prefix}/var
+%global _libdir			%{_exec_prefix}/%{_lib}
+%global _includedir		%{_prefix}/include
+%global _infodir		%{_datadir}/info
+%global _mandir			%{_datadir}/man
+%global _docdir			%{_datadir}/doc
+%global _defaultdocdir		%{_docdir}
+%global scl_pkg_name		%{scl_short_prefix}_%{scl}_%{pkg_name}
+BuildRequires: scl-utils-build
+}}
+
+%scl_require()	%{_scl_prefix}/%1/enable
+
+%scl_files %{expand:
+%{_scl_root}
+%{_scl_scripts}
+%{_scl_scripts}/enable
+%{_root_sysconfdir}/scl/prefixes/%scl
+}
+
+%scl_install %{expand:
+mkdir -p %{buildroot}%{_root_sysconfdir}/{rpm,scl/prefixes}
+echo -n '%' > %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
+cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config << EOF
+scl %scl
+EOF
+cat >> %{buildroot}%{_root_sysconfdir}/scl/prefixes/%{scl} << EOF
+%_scl_prefix
+EOF
+}
diff --git a/scl-utils.spec b/scl-utils.spec
index 85fc52f..89cac0e 100644
--- a/scl-utils.spec
+++ b/scl-utils.spec
@@ -1,12 +1,11 @@
 Summary:	Utilities for alternative packaging
 Name:		scl-utils
-Version:	20120111
+Version:	20120125
 Release:	1%{?dist}
 License:	GPLv2+
 Group:		Applications/File
 URL:		http://jnovy.fedorapeople.org/scl-utils/
 Source0:	http://jnovy.fedorapeople.org/scl-utils/%{name}-%{version}.tar.gz
-Provides:	dsc-utils = %version
 Buildroot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %description
@@ -15,7 +14,6 @@ Run-time utility for alternative packaging.
 %package build
 Summary:	RPM build macros for alternative packaging
 Group:		Applications/File
-Provides:	dsc-utils-build = %version
 
 %description build
 Essential RPM build macros for alternative packaging.
@@ -41,15 +39,18 @@ rm -rf %buildroot
 %defattr(-,root,root,-)
 %dir /opt/rh
 %dir %{_sysconfdir}/scl/prefixes
-%{_bindir}/dsc
 %{_bindir}/scl
 %{_bindir}/scl_enabled
 
 %files build
 %defattr(-,root,root,-)
-%{_sysconfdir}/rpm/macros.dsc
+%{_sysconfdir}/rpm/macros.scl
 
 %changelog
+* Wed Jan 25 2012 Jindrich Novy <jnovy at redhat.com> 20120125-1
+- remove dsc macros
+- trigger scl-utils-build BR inclusion while using scl macros
+
 * Wed Jan 11 2012 Jindrich Novy <jnovy at redhat.com> 20120111-1
 - add "dsc" alias to "scl" utility
 
diff --git a/sources b/sources
index cc149b2..ce0fd56 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-f48a6288f723b109b8af16b71bb6cc29  scl-utils-20120111.tar.gz
+0b360ad5b6e36615d1b53f55075a787e  scl-utils-20120125.tar.gz


More information about the scm-commits mailing list