summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert@lshift.net>2008-10-16 18:33:44 +0100
committerHubert Plociniczak <hubert@lshift.net>2008-10-16 18:33:44 +0100
commitc3feec7be0240ebe89137d9db66fd17fedd40a75 (patch)
tree0e0ea536a00c43d4f20d59268c23d9a49827f425
parent3c462730fe27e219e3b57ddecfeea95c35640e14 (diff)
downloadrabbitmq-server-c3feec7be0240ebe89137d9db66fd17fedd40a75.tar.gz
Spec no longer requires non-standard macros,
include rpm-specifc files as sources instead of patch
-rw-r--r--packaging/RPMS/Fedora/Makefile17
-rw-r--r--packaging/RPMS/Fedora/rabbitmq-server.spec30
2 files changed, 19 insertions, 28 deletions
diff --git a/packaging/RPMS/Fedora/Makefile b/packaging/RPMS/Fedora/Makefile
index a1430432..4824b629 100644
--- a/packaging/RPMS/Fedora/Makefile
+++ b/packaging/RPMS/Fedora/Makefile
@@ -5,8 +5,7 @@ SOURCE_TARBALL_DIR=../../../dist
PACKAGE_VERSION_NAME=rabbitmq-server-$(VERSION)
TARBALL=$(SOURCE_TARBALL_DIR)/$(PACKAGE_VERSION_NAME).tar.gz
TOP_DIR=$(shell pwd)
-RPM_VERSION=$(shell echo $(VERSION) | tr - _)
-DEFINES=--define '_topdir $(TOP_DIR)' --define '_tmppath $(TOP_DIR)/tmp' --define 'main_version $(VERSION)' --define 'rpm_version $(RPM_VERSION)'
+DEFINES=--define '_topdir $(TOP_DIR)' --define '_tmppath $(TOP_DIR)/tmp'
RPM_SOURCE_DIR=$(PACKAGE_VERSION_NAME)/rpm
rpms: clean server
@@ -16,17 +15,11 @@ prepare:
mkdir -p BUILD SOURCES SPECS SRPMS RPMS tmp
cp $(TOP_DIR)/$(TARBALL) SOURCES
cp rabbitmq-server.spec SPECS
+ sed -i 's/%%VERSION%%/$(VERSION)/' SPECS/rabbitmq-server.spec
- rm -rf tmp/$(PACKAGE_VERSION_NAME)*
- tar -zxf $(TOP_DIR)/$(TARBALL) -C tmp
- cp -r tmp/$(PACKAGE_VERSION_NAME) tmp/$(PACKAGE_VERSION_NAME)-orig
-
- mkdir tmp/$(RPM_SOURCE_DIR)
- cp init.d tmp/$(RPM_SOURCE_DIR)
- cp rabbitmqctl_wrapper tmp/$(RPM_SOURCE_DIR)
- cp rabbitmq-server.logrotate tmp/$(RPM_SOURCE_DIR)
- - (cd tmp; diff -aurN $(PACKAGE_VERSION_NAME)-orig $(PACKAGE_VERSION_NAME) \
- > ../SOURCES/rpm.patch )
+ cp init.d SOURCES/rabbitmq-server.init
+ cp rabbitmqctl_wrapper SOURCES/rabbitmq-server.wrapper
+ cp rabbitmq-server.logrotate SOURCES/rabbitmq-server.logrotate
server: prepare
rpmbuild -ba SPECS/rabbitmq-server.spec $(DEFINES) --target noarch
diff --git a/packaging/RPMS/Fedora/rabbitmq-server.spec b/packaging/RPMS/Fedora/rabbitmq-server.spec
index b642b1fe..d4e21ebe 100644
--- a/packaging/RPMS/Fedora/rabbitmq-server.spec
+++ b/packaging/RPMS/Fedora/rabbitmq-server.spec
@@ -1,15 +1,17 @@
Name: rabbitmq-server
-Version: %{rpm_version}
+Version: %%VERSION%%
Release: 1
License: MPLv1.1
Group: Development/Libraries
-Source: http://www.rabbitmq.com/releases/rabbitmq-server/v%{main_version}/%{name}-%{main_version}.tar.gz
+Source: http://www.rabbitmq.com/releases/rabbitmq-server/v%{version}/%{name}-%{version}.tar.gz
+Source1: rabbitmq-server.init
+Source2: rabbitmq-server.wrapper
+Source3: rabbitmq-server.logrotate
URL: http://www.rabbitmq.com/
Vendor: LShift Ltd., Cohesive Financial Technologies LLC., Rabbit Technlogies Ltd.
Requires: erlang, logrotate
Packager: Hubert Plociniczak <hubert@lshift.net>
-Patch0: rpm.patch
-BuildRoot: %{_tmppath}/%{name}-%{main_version}-%{release}-root
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Summary: The RabbitMQ server
Requires(post): chkconfig
Requires(pre): chkconfig initscripts
@@ -20,10 +22,8 @@ performance enterprise messaging. The RabbitMQ server is a robust and
scalable implementation of an AMQP broker.
-%define _mandir /usr/share/man
-%define _sbindir /usr/sbin
-%define _libdir %(erl -noshell -eval "io:format('~s~n', [code:lib_dir()]), halt().")
-%define _maindir %{buildroot}%{_libdir}/rabbitmq_server-%{main_version}
+%define _erllibdir %(erl -noshell -eval "io:format('~s~n', [code:lib_dir()]), halt().")
+%define _maindir %{buildroot}%{_erllibdir}/rabbitmq_server-%{version}
%pre
@@ -34,8 +34,7 @@ if [ $1 -gt 1 ]; then
fi
%prep
-%setup -n %{name}-%{main_version}
-%patch -p1
+%setup -n %{name}-%{version}
%build
make
@@ -46,24 +45,23 @@ rm -rf %{buildroot}
make install TARGET_DIR=%{_maindir} \
SBIN_DIR=%{buildroot}%{_sbindir} \
MAN_DIR=%{buildroot}%{_mandir}
- VERSION=%{main_version}
+ VERSION=%{version}
mkdir -p %{buildroot}/var/lib/rabbitmq/mnesia
mkdir -p %{buildroot}/var/log/rabbitmq
mkdir -p %{buildroot}/etc/rc.d/init.d/
#Copy all necessary lib files etc.
-cp rpm/init.d %{buildroot}/etc/rc.d/init.d/rabbitmq-server
+install -m 0755 %SOURCE1 %{buildroot}/etc/rc.d/init.d/rabbitmq-server
chmod 0755 %{buildroot}/etc/rc.d/init.d/rabbitmq-server
mv %{buildroot}/usr/sbin/rabbitmqctl %{buildroot}/usr/sbin/rabbitmqctl_real
-cp rpm/rabbitmqctl_wrapper %{buildroot}/usr/sbin/rabbitmqctl
-chmod 0755 %{buildroot}/usr/sbin/rabbitmqctl
+install -m 0755 %SOURCE2 %{buildroot}/usr/sbin/rabbitmqctl
cp %{buildroot}%{_mandir}/man1/rabbitmqctl.1.gz %{buildroot}%{_mandir}/man1/rabbitmqctl_real.1.gz
mkdir -p %{buildroot}/etc/logrotate.d
-cp rpm/rabbitmq-server.logrotate %{buildroot}/etc/logrotate.d/rabbitmq-server
+install %SOURCE3 %{buildroot}/etc/logrotate.d/rabbitmq-server
%post
# create rabbitmq group
@@ -95,7 +93,7 @@ fi
%files
%defattr(-,root,root,-)
-%{_libdir}/rabbitmq_server-%{main_version}/
+%{_erllibdir}/rabbitmq_server-%{version}/
%{_mandir}/man1/rabbitmq-multi.1.gz
%{_mandir}/man1/rabbitmq-server.1.gz
%{_mandir}/man1/rabbitmqctl.1.gz