From 33b534acd9f7a208c09cca606933bfed7348014b Mon Sep 17 00:00:00 2001 From: Yunhui Fu Date: Sun, 18 Jan 2015 16:29:15 -0500 Subject: [PATCH] add rpm support in Makefile.am --- rpm/Makefile.am | 17 +++++++++++++++++ rpm/{libucd.spec => libucd.spec.in} | 14 ++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 rpm/Makefile.am rename rpm/{libucd.spec => libucd.spec.in} (90%) diff --git a/rpm/Makefile.am b/rpm/Makefile.am new file mode 100644 index 0000000..f72a56d --- /dev/null +++ b/rpm/Makefile.am @@ -0,0 +1,17 @@ +AUTOMAKE_OPTIONS = foreign + +EXTRA_DIST=libucd.spec + +# define rpm build root +RPMBUILDTOPDIR = $(shell unset RPMBUILDTOPDIR; if [ -f ${HOME}/.rpmmacros ]; then export RPMBUILDTOPDIR=`grep _topdir ${HOME}/.rpmmacros|awk '{print $$2}'`; else export RPMBUILDTOPDIR=/usr/src/redhat; fi; echo $${RPMBUILDTOPDIR};) + +.PHONY: rpm + +rpm: @PACKAGE@.spec + $(RM) ${RPMBUILDTOPDIR}/SOURCES/$(distdir).tar.gz + $(RM) ${RPMBUILDTOPDIR}/SPECS/@PACKAGE@.spec + $(LN_S) `pwd`/$(distdir).tar.gz ${RPMBUILDTOPDIR}/SOURCES + $(LN_S) `pwd`/@PACKAGE@.spec ${RPMBUILDTOPDIR}/SPECS + rpmbuild -ba ${RPMBUILDTOPDIR}/SPECS/@PACKAGE@.spec + +CLEANFILES = *~ *.log *.tar.gz diff --git a/rpm/libucd.spec b/rpm/libucd.spec.in similarity index 90% rename from rpm/libucd.spec rename to rpm/libucd.spec.in index c596652..c70e1a4 100644 --- a/rpm/libucd.spec +++ b/rpm/libucd.spec.in @@ -1,10 +1,10 @@ %global commit 872e0950ccaced127fe91a49d19ebf6348b083f9 -%global shortcommit %(c=%{commit}; echo ${c:0:7}) -%global shortname cpp-libucd +%global shortcommit @VERSION@ +%global shortname @PACKAGE@ Name: libucd -Version: 1.0.0 -Release: 1.git%{shortcommit}%{?dist} +Version: %{shortcommit} +Release: 1 Summary: Mozilla's Universal Charset Detector C/C++ API Summary(ko): 모질라 유니버샬 캐릭터셋 디텍트 라이브러리 Summary(zh): Mozilla 字符集检测 C/C++ API @@ -30,7 +30,7 @@ Summary(ko): %{name} 를 이용하여 개발하기 위한 header 파일과 Summary(zh): %{name} 的开发用库文件 Group: Development/Libraries #Requires: pkgconfig -Requires: %{name}%{_isa} = %{version}-%{release} +Requires: %{name}%{_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for @@ -45,7 +45,8 @@ touch TODO Copyright %configure \ --enable-debug=no \ --enable-static \ - --enable-shared=no + --enable-shared=no \ + --disable-icu make %{_smp_mflags} gzip -9 ChangeLog @@ -86,6 +87,7 @@ rm -fr %{buildroot} #%{_libdir}/*.sh %{_includedir}/* %{_libdir}/pkgconfig/%{name}.pc +%{_bindir}/ucd #/usr/share/doc/%{name}/html %changelog