diff --git a/hawk/Makefile.am b/hawk/Makefile.am index 1898505a..79401631 100644 --- a/hawk/Makefile.am +++ b/hawk/Makefile.am @@ -14,3 +14,16 @@ DIST_SUBDIRS = $(SUBDIRS) t distclean-local: @rm -rf $(top_srcdir)/autom4te.cache + +###################################################################### + +TARGET ?= @build_cpu@ + +rpm: dist-gzip + mkdir -p "@abs_builddir@/pkgs/RPM/BUILD" + mkdir -p "@abs_builddir@/pkgs/RPM/SOURCES" + mkdir -p "@abs_builddir@/pkgs/RPM/SRPMS" + mkdir -p "@abs_builddir@/pkgs/RPM/RPMS" + cp @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz "@abs_builddir@/pkgs/RPM/SOURCES" + rpmbuild --define "_topdir @abs_builddir@/pkgs/RPM" -ba @abs_builddir@/pkgs/hawk.spec --target=$(TARGET) + diff --git a/hawk/Makefile.in b/hawk/Makefile.in index 03c43af7..a721faa5 100644 --- a/hawk/Makefile.in +++ b/hawk/Makefile.in @@ -107,7 +107,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/hawk-cfg.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = pkgs/hawk.spec CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -167,9 +167,10 @@ CSCOPE = cscope am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/ar-lib \ $(top_srcdir)/ac/compile $(top_srcdir)/ac/config.guess \ $(top_srcdir)/ac/config.sub $(top_srcdir)/ac/install-sh \ - $(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing ac/ar-lib \ - ac/compile ac/config.guess ac/config.sub ac/depcomp \ - ac/install-sh ac/ltmain.sh ac/missing + $(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing \ + $(top_srcdir)/pkgs/hawk.spec.in ac/ar-lib ac/compile \ + ac/config.guess ac/config.sub ac/depcomp ac/install-sh \ + ac/ltmain.sh ac/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -411,6 +412,8 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): +pkgs/hawk.spec: $(top_builddir)/config.status $(top_srcdir)/pkgs/hawk.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo @@ -848,6 +851,18 @@ uninstall-am: distclean-local: @rm -rf $(top_srcdir)/autom4te.cache +###################################################################### + +TARGET ?= @build_cpu@ + +rpm: dist-gzip + mkdir -p "@abs_builddir@/pkgs/RPM/BUILD" + mkdir -p "@abs_builddir@/pkgs/RPM/SOURCES" + mkdir -p "@abs_builddir@/pkgs/RPM/SRPMS" + mkdir -p "@abs_builddir@/pkgs/RPM/RPMS" + cp @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz "@abs_builddir@/pkgs/RPM/SOURCES" + rpmbuild --define "_topdir @abs_builddir@/pkgs/RPM" -ba @abs_builddir@/pkgs/hawk.spec --target=$(TARGET) + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/hawk/configure b/hawk/configure index aeebc511..b599fbd9 100755 --- a/hawk/configure +++ b/hawk/configure @@ -23343,7 +23343,7 @@ HAWK_PROJECT_AUTHOR="${PACKAGE_BUGREPORT}" HAWK_PROJECT_URL="${PACKAGE_URL}" -ac_config_files="$ac_config_files Makefile tools/Makefile lib/Makefile mod/Makefile bin/Makefile samples/Makefile t/Makefile" +ac_config_files="$ac_config_files Makefile tools/Makefile lib/Makefile mod/Makefile bin/Makefile samples/Makefile t/Makefile pkgs/hawk.spec" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -24515,6 +24515,7 @@ do "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; "samples/Makefile") CONFIG_FILES="$CONFIG_FILES samples/Makefile" ;; "t/Makefile") CONFIG_FILES="$CONFIG_FILES t/Makefile" ;; + "pkgs/hawk.spec") CONFIG_FILES="$CONFIG_FILES pkgs/hawk.spec" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/hawk/configure.ac b/hawk/configure.ac index 0bd22ee5..dc758ffe 100644 --- a/hawk/configure.ac +++ b/hawk/configure.ac @@ -1022,6 +1022,7 @@ AC_CONFIG_FILES([ bin/Makefile samples/Makefile t/Makefile + pkgs/hawk.spec ]) AC_OUTPUT diff --git a/hawk/pkgs/hawk.spec.in b/hawk/pkgs/hawk.spec.in new file mode 100644 index 00000000..081495a1 --- /dev/null +++ b/hawk/pkgs/hawk.spec.in @@ -0,0 +1,58 @@ +%define _prefix /usr +%define _sysconfdir /etc + +Summary: HAWK Interpreter +Name: @PACKAGE_NAME@ +Version: @PACKAGE_VERSION@ +Release: 1%{?dist} +License: Simplified BSD License +Vendor: Chung, Hyung-Hwan +URL: @PACKAGE_URL@ +Group: System Environment/Libraries +Source0: %{name}-%{version}.tar.gz +#Requires: + +BuildRequires: mysql-devel +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +%description +HAWK Interpreter + +%package devel +Summary: Development files for HAWK +Group: System Environment/Libraries +Requires: @PACKAGE_NAME@ = %{version} + +%description devel +The header files and libraries for developing applications with HAWK. + +%prep +%setup -q + +%build +RPM_OPT_FLAGS="$(echo $RPM_OPT_FLAGS | %{__sed} 's/-O2/-O3/')" +CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS} -std=c++11" ./configure --prefix=%{_prefix} --libdir=%{_libdir} --sysconfdir=%{_sysconfdir} --enable-shared=no --enable-static-module=yes --enable-unicode="yes:2w" --enable-cxx=yes --enable-mod=mysql=yes --enable-mod-uci=no ##CC=gcc44 CXX=g++44 +make + +%install +make install DESTDIR=$RPM_BUILD_ROOT +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la +rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig + +%clean +rm -rf "$RPM_BUILD_ROOT" + +%post +/sbin/ldconfig + +%postun +/sbin/ldconfig + +%files +%defattr(-,root,root) +%{_bindir}/* + +%files devel +%defattr(-,root,root) +%{_includedir}/* +%{_libdir}/*.a