From cf14d020af1d3d46925c2b7e3237d904c6126a54 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 17 Jan 2017 10:33:10 -0200 Subject: [PATCH] Ajustes para empacotamento --- .gitignore | 9 ++++++++- Makefile.in | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ debian/changelog | 6 ++++++ debian/control | 13 +++++++++++++ debian/rules | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ php5-pw3270.spec | 70 ---------------------------------------------------------------------- rpm/php5-pw3270.spec | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 281 insertions(+), 71 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/rules delete mode 100644 php5-pw3270.spec create mode 100644 rpm/php5-pw3270.spec diff --git a/.gitignore b/.gitignore index 2315cad..929943a 100644 --- a/.gitignore +++ b/.gitignore @@ -15,10 +15,17 @@ stamp-h1 *.zip *.tar *.bz2 -rpm *.depend ChangeLog revision revision.m4 php3270.h *.ini +rpm/BUILD +rpm/BUILDROOT +rpm/RPMS +rpm/SOURCES +rpm/SPECS +rpm/SRPMS + + diff --git a/Makefile.in b/Makefile.in index 1f8b0f2..545b2fe 100644 --- a/Makefile.in +++ b/Makefile.in @@ -62,6 +62,7 @@ SHELL=@SHELL@ STRIP=@STRIP@ MKDIR=@MKDIR_P@ PHPCONFIG=@PHPCONFIG@ +RPMBUILD=@RPMBUILD@ CXX=@CXX@ CC=@CC@ @@ -95,6 +96,20 @@ $(OBJRLS)/%.o: \ -DBUILD_DATE=`date +"0x%Y%m%d"` \ -o $@ -c $< +%.tar.bz2: \ + %.tar + + @echo $< ... + @bzip2 --compress -9 --stdout $< > $@ + @chmod 0644 $@ + +%.tar.gz: \ + %.tar + + @echo $< ... + @gzip -9 --stdout $< > $@ + @chmod 0644 $@ + #---[ Release Targets ]------------------------------------------------------------------ all: \ @@ -112,6 +127,83 @@ install: \ @$(MKDIR) $(DESTDIR)/@PHPCONFDIR@ @$(INSTALL_DATA) php.ini $(DESTDIR)/@PHPCONFDIR@/tn3270.ini +rpm: \ + $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \ + rpm/php5-pw3270.spec \ + Makefile + + $(MKDIR) $(BASEDIR)/rpm + $(MKDIR) $(BASEDIR)/rpm/SPECS + $(MKDIR) $(BASEDIR)/rpm/SOURCES + $(MKDIR) $(BASEDIR)/rpm/SRPMS + $(MKDIR) $(BASEDIR)/rpm/RPMS + $(MKDIR) $(BASEDIR)/rpm/BUILD + $(MKDIR) $(BASEDIR)/rpm/BUILDROOT + umask 002 ; $(RPMBUILD) \ + --define="_topdir $(BASEDIR)/rpm" \ + --define="_packager $(USER)@$(HOSTNAME)" \ + --clean \ + -ta $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 + +srpm: \ + $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \ + rpm/php5-pw3270.spec \ + Makefile + + @$(MKDIR) $(BASEDIR)/rpm + @$(MKDIR) $(BASEDIR)/rpm/SPECS + @$(MKDIR) $(BASEDIR)/rpm/SOURCES + @$(MKDIR) $(BASEDIR)/rpm/SRPMS + @$(MKDIR) $(BASEDIR)/rpm/RPMS + @$(MKDIR) $(BASEDIR)/rpm/BUILD + @$(MKDIR) $(BASEDIR)/rpm/BUILDROOT + @umask 002 ; $(RPMBUILD) \ + --define="_topdir $(PWD)/rpm" \ + --define="_packager $(USER)@$(HOSTNAME)" \ + --clean \ + -ts $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 + +$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar: \ + $(SRCDIR) + + @$(AMTAR) \ + --verbose \ + --format=ustar \ + --create \ + --exclude-vcs \ + --directory $(BASEDIR)/.src \ + --owner=root \ + --group=root \ + --file=$@ \ + $(PACKAGE_TARNAME)-@PACKAGE_VERSION@ + + +$(SRCDIR): \ + clean \ + Makefile + + # Copia fontes + @$(MKDIR) $(SRCDIR)/src + @cp src/*.cc $(SRCDIR)/src + @cp src/*.in $(SRCDIR)/src + + # Copia extras + @cp -r scripts $(SRCDIR) + @cp -r testprograms $(SRCDIR) + + # Copia documentos + @cp AUTHORS $(SRCDIR) + @cp LICENCA $(SRCDIR) + @cp LICENSE $(SRCDIR) + @cp README.md $(SRCDIR) + + # Copia configuradores + @cp configure.ac $(SRCDIR) + @cp *.in $(SRCDIR) + @cp *.cbp $(SRCDIR) + @cp rpm/*.spec $(SRCDIR) + + $(BINRLS)/$(LIBNAME): \ $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC).o) diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..9fdf920 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +php5-pw3270 (5.1-0) unstable; urgency=low + + * Unstable release + + -- Perry Werneck Thu, 19 Apr 2016 17:38:00 -0300 + diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..8bb8f3c --- /dev/null +++ b/debian/control @@ -0,0 +1,13 @@ +Source: php5-pw3270 +Section: unknown +Priority: optional +Maintainer: Perry Werneck +Build-Depends: debhelper (>= 7), autotools-dev, autoconf, gettext, php5-dev, pw3270-dev + +Package: php5-pw3270 +Architecture: any +Depends: ${misc:Depends}, lib3270 (= ${binary:Version}) +Description: PHP Extension Module implementing tn3270 protocol. + This is an extension for acessing 3270 hosts directly from PHP apps. + + diff --git a/debian/rules b/debian/rules new file mode 100644 index 0000000..996b0d6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,96 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +# This is the debhelper compatibility version to use. +export DH_COMPAT=4 + +CFLAGS = -g +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) +CFLAGS += -O0 +else +CFLAGS += -O2 +endif + +build: build-stamp +build-stamp: + dh_testdir + + # Add here commands to compile the package. + aclocal + autoconf + + ./configure + + rm -f debian/*.install + make clean + make Release + # --- end custom part for compiling + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + if [ -e Makefile ]; then make clean ; fi + # --- end custom part for cleaning up + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Install ooRexx extension + make DESTDIR=$(PWD)/debian/php5-pw3270 install + + # Create updated file lists + find $(PWD)/debian/php5-pw3270 -type f | sed -e "s@^$(PWD)/debian/php5-pw3270/@/@g" > $(PWD)/debian/php5-pw3270.install + + + # --- end custom part for installing + +# Build architecture-independent files here. +binary-indep: build install + # We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs + dh_installexamples + dh_installmenu +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit + dh_installcron + dh_installman + dh_installinfo +# dh_undocumented + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_makeshlibs + dh_installdeb +# dh_perl +# dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff --git a/php5-pw3270.spec b/php5-pw3270.spec deleted file mode 100644 index f17b911..0000000 --- a/php5-pw3270.spec +++ /dev/null @@ -1,70 +0,0 @@ -%define _phpextdir %(php-config --extension-dir) -%define _phpconf %(php-config | sed 's@ @\\n@g' | grep "^--with-config-file-scan-dir=" | cut -d= -f2) - -Summary: PHP5 Extension Module implementing tn3270 protocol -Name: php5-pw3270 -Version: 5.1 -Release: 0 -License: GPL-2.0 -Source: %{name}-%{version}.tar.bz2 -URL: https://portal.softwarepublico.gov.br/social/pw3270/ -Group: Development/Languages/PHP - -BuildRoot: /var/tmp/%{name}-%{version} - -BuildRequires: autoconf >= 2.61 -BuildRequires: automake -BuildRequires: binutils -BuildRequires: coreutils -BuildRequires: gcc-c++ -BuildRequires: m4 -BuildRequires: pkgconfig -BuildRequires: php5-devel -BuildRequires: pw3270-devel >= 5.1 - -Requires: pw3270 >= 5.1 - -%description - -This is an extension for acessing 3270 hosts directly -from PHP apps. - -%prep - -%setup - -export CFLAGS="$RPM_OPT_FLAGS" -export CXXFLAGS="$RPM_OPT_FLAGS" -export FFLAGS="$RPM_OPT_FLAGS" - -aclocal -autoconf -%configure - -%build -make clean -make Release - -%install -rm -rf $RPM_BUILD_ROOT - -%makeinstall - -%fdupes $RPM_BUILD_ROOT - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%config %{_phpconf}/tn3270.ini -%{_phpextdir}/*.so - -%files -n ooRexx-extension-tn3270 -%{_libdir}/librx3270.* -%{_datadir}/ooRexx/rx3270.cls - - -%changelog - - diff --git a/rpm/php5-pw3270.spec b/rpm/php5-pw3270.spec new file mode 100644 index 0000000..d90102b --- /dev/null +++ b/rpm/php5-pw3270.spec @@ -0,0 +1,66 @@ +%define _phpextdir %(php-config --extension-dir) +%define _phpconf %(php-config | sed 's@ @\\n@g' | grep "^--with-config-file-scan-dir=" | cut -d= -f2) + +Summary: PHP5 Extension Module implementing tn3270 protocol +Name: php5-pw3270 +Version: 5.1 +Release: 0 +License: GPL-2.0 +Source: %{name}-%{version}.tar.bz2 +URL: https://softwarepublico.gov.br/gitlab/pw3270/pw3270-php5 +Group: Development/Languages/PHP + +BuildRoot: /var/tmp/%{name}-%{version} + +BuildRequires: autoconf >= 2.61 +BuildRequires: automake +BuildRequires: binutils +BuildRequires: coreutils +BuildRequires: gcc-c++ +BuildRequires: m4 +BuildRequires: pkgconfig +BuildRequires: php5-devel +BuildRequires: pw3270-devel >= 5.1 + +Requires: lib3270 >= 5.1 +Requires: php5 + +%description + +This is an extension for acessing 3270 hosts directly +from PHP apps. + +%prep + +%setup + +export CFLAGS="$RPM_OPT_FLAGS" +export CXXFLAGS="$RPM_OPT_FLAGS" +export FFLAGS="$RPM_OPT_FLAGS" + +aclocal +autoconf +%configure + +%build +make clean +make Release + +%install +rm -rf $RPM_BUILD_ROOT + +%makeinstall + +%fdupes $RPM_BUILD_ROOT + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%config %{_phpconf}/tn3270.ini +%{_phpextdir}/*.so + +%changelog + + -- libgit2 0.21.2