Browse Source

Packagemonkey generation

fuzzgun 8 years ago
parent
commit
537d92c06e
12 changed files with 151 additions and 79 deletions
  1. 6 0
      Makefile
  2. 3 3
      arch.sh
  3. 5 5
      archpackage/PKGBUILD
  4. 1 0
      configure
  5. 8 12
      debian/control
  6. 4 4
      debian/copyright
  7. 9 17
      debian/rules
  8. 30 0
      ebuild.sh
  9. 5 0
      generate.sh
  10. 58 0
      puppy.sh
  11. 11 10
      rpm.sh
  12. 11 28
      rpmpackage/fin.spec

+ 6 - 0
Makefile

@@ -19,9 +19,15 @@ install:
 	mkdir -p $(DESTDIR)/usr/share/man/man1
 	install -m 755 $(APP) $(DESTDIR)/usr/bin
 	install -m 644 man/$(APP).1.gz $(DESTDIR)/usr/share/man/man1
+	install -m 755 --strip $(APP) $(DESTDIR)/usr/bin
+	mkdir -m 755 -p $(DESTDIR)/usr/share
+	mkdir -m 755 -p $(DESTDIR)/usr/share/man
+	mkdir -m 755 -p $(DESTDIR)/usr/share/man/man1
 
 clean:
 	rm -f $(APP) \#* \.#* gnuplot* *.png debian/*.substvars debian/*.log
 	rm -rf deb.* debian/$(APP) rpmpackage/$(ARCH_TYPE)
 	rm -f ../$(APP)*.deb ../$(APP)*.changes ../$(APP)*.asc ../$(APP)*.dsc
 	rm -f rpmpackage/*.src.rpm archpackage/*.gz
+	rm -fr deb.* debian/$(APP) rpmpackage/$(ARCH_TYPE)
+	rm -f rpmpackage/*.src.rpm archpackage/*.gz puppypackage/*.gz puppypackage/*.pet

+ 3 - 3
arch.sh

@@ -9,14 +9,14 @@ CURRDIR=`pwd`
 SOURCE=archpackage/${APP}-${VERSION}.tar.gz
 
 # Update version numbers automatically - so you don't have to
-sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' Makefile debian.sh rpm.sh
+sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' Makefile debian.sh rpm.sh puppy.sh ebuild.sh
 sed -i 's/Version: '${PREV_VERSION}'/Version: '${VERSION}'/g' rpmpackage/${APP}.spec
 sed -i 's/Release: '${RELEASE}'/Release: '${RELEASE}'/g' rpmpackage/${APP}.spec
 sed -i 's/pkgrel='${RELEASE}'/pkgrel='${RELEASE}'/g' archpackage/PKGBUILD
 sed -i 's/pkgver='${PREV_VERSION}'/pkgver='${VERSION}'/g' archpackage/PKGBUILD
+sed -i "s/-${PREV_VERSION}-/-${VERSION}-/g" puppypackage/pet.specs
+sed -i "s/|${PREV_VERSION}|/|${VERSION}|/g" puppypackage/pet.specs
 
-# Set the type of architecture
-sed -i "s/arch=('any')/arch=('${ARCH_TYPE}')/g" "archpackage/PKGBUILD"
 
 # Create the source code
 make clean

+ 5 - 5
archpackage/PKGBUILD

@@ -2,13 +2,13 @@
 pkgname=fin
 pkgver=1.51
 pkgrel=1
-pkgdesc="Keeping track of personal finances is an incredibly boring task, and if you don't have much money then juggling it can be tricky.  When looking at the existing software out there to manage accounts it's frequently highly complex and top heavy.  Fin - an abbreviation of "financials" - is an attempt to do the opposite of what most accounting software does, and that's to make things incredibly simple and quick.  Logging a transaction or viewing your current balance should take no more than a few seconds.  This means less time wasted on bureaucracy and more time spent on what you really want to be doing.  Fin can import and export to CSV files, Emacs org mode tables and GnuCash."
-arch=('x86_64' 'i686')
+pkgdesc="Keeping track of personal finances is an incredibly boring task, and if you don't have much money then juggling it can be tricky. When looking at the existing software out there to manage accounts it's frequently highly complex and top heavy. Fin - an abbreviation of "financials" - is an attempt to do the opposite of what most accounting software does, and that's to make things incredibly simple and quick. Logging a transaction or viewing your current balance should take no more than a few sec"
+arch=('i686' 'x86_64')
 url="https://github.com/fuzzgun/fin"
 license=('GPL3')
 groups=()
-depends=('gnuplot' 'sqlite')
-makedepends=('sqlite')
+depends=( 'gnuplot' 'sqlite')
+makedepends=( 'sqlite')
 optdepends=()
 provides=()
 conflicts=()
@@ -19,7 +19,7 @@ install=
 changelog=
 source=($pkgname-$pkgver.tar.gz)
 noextract=()
-md5sums=(103ad9df6fbccbedc3ec0c8c9b926aa1)
+md5sums=()
 build() {
   cd "$srcdir/$pkgname-$pkgver"
   ./configure --prefix=/usr

+ 1 - 0
configure

@@ -0,0 +1 @@
+ 

+ 8 - 12
debian/control

@@ -1,11 +1,10 @@
 Source: fin
-Section: contrib/utils
+Section: utils
 Priority: extra
 Maintainer: Bob Mottram (4096 bits) <bob@robotics.uk.to>
 Build-Depends: debhelper (>= 9.0.0), libsqlite3-dev
 Standards-Version: 3.9.4
-Homepage: https://launchpad.net/fin
-Vcs-Browser: https://github.com/fuzzgun/fin
+Homepage: https://github.com/fuzzgun/fin
 Vcs-Git: https://github.com/fuzzgun/fin.git
 
 Package: fin
@@ -13,12 +12,9 @@ Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, gnuplot, bcrypt, sqlite3
 Description: Command line personal finances manager
  Keeping track of personal finances is an incredibly boring task, and if
- you don't have much money then juggling it can be tricky.  When looking
- at the existing software out there to manage accounts it's frequently
- highly complex and top heavy.  Fin - an abbreviation of "financials" -
- is an attempt to do the opposite of what most accounting software does,
- and that's to make things incredibly simple and quick.  Logging a
- transaction or viewing your current balance should take no more than a
- few seconds.  This means less time wasted on bureaucracy and more time
- spent on what you really want to be doing.  Fin can import and export
- to CSV files, Emacs org mode tables and GnuCash.
+ you don't have much money then juggling it can be tricky. When looking at
+ the existing software out there to manage accounts it's frequently highly
+ complex and top heavy. Fin - an abbreviation of "financials" - is an
+ attempt to do the opposite of what most accounting software does, and
+ that's to make things incredibly simple and quick. Logging a transaction
+ or viewing your current balance should take no more than a few sec

+ 4 - 4
debian/copyright

@@ -1,13 +1,13 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: fin
-Source: https://github.com/fuzzgun/fin
+Upstream-Name: 
+Source: 
 
 Files: *
-Copyright: 2011-2012 Bob Mottram <bob@robotics.uk.to>
+Copyright: Copyright 2013 Bob Mottram (4096 bits) <bob@robotics.uk.to>
 License: GPL-3.0+
 
 Files: debian/*
-Copyright: 2012 Bob Mottram <bob@robotics.uk.to>
+Copyright: Copyright 2013 Bob Mottram (4096 bits) <bob@robotics.uk.to>
 License: GPL-3.0+
 
 License: GPL-3.0+

+ 9 - 17
debian/rules

@@ -1,19 +1,10 @@
 #!/usr/bin/make -f
 
 APP=fin
-
-fin_application = $(CURDIR)/$(APP)
-
-DEST_APP = $(CURDIR)/debian/$(APP)/usr/bin
-
-CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
-CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
-CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
-LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
-
+application = $(CURDIR)/$(APP)
+DESTDIR=$(CURDIR)/debian/$(APP)
 build: build-stamp
-	gcc -Wall -ansi -pedantic -O3 $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) $(CXXFLAGS) -o $(APP) src/*.c -Isrc -lsqlite3
-
+	make
 build-arch: build-stamp
 build-indep: build-stamp
 build-stamp:
@@ -26,15 +17,16 @@ clean:
 		rm -f build-stamp
 		dh_clean
 
-install: build clean $(fin_application)
+install: build clean $(application)
 		 dh_testdir
 		 dh_testroot
 		 dh_prep
 		 dh_installdirs
-
-		 mkdir -m 755 -p $(DEST_APP)
-		 install -m 755 --strip $(fin_application) $(DEST_APP)
-
+		 mkdir -m 755 -p $(CURDIR)/debian/$(APP)/usr/bin
+		 mkdir -m 755 -p $(CURDIR)/debian/$(APP)/usr/share
+		 mkdir -m 755 -p $(CURDIR)/debian/$(APP)/usr/share/man
+		 mkdir -m 755 -p $(CURDIR)/debian/$(APP)/usr/share/man/man1
+		 install -m 755 --strip $(APP) $(DESTDIR)/usr/bin
 binary-indep: build install
 			  dh_shlibdeps
 			  dh_testdir

+ 30 - 0
ebuild.sh

@@ -0,0 +1,30 @@
+#!/bin/bash
+
+APP=fin
+PREV_VERSION=1.51
+VERSION=1.51
+RELEASE=1
+SOURCEDIR=.
+ARCH_TYPE=`uname -m`
+CURRDIR=`pwd`
+SOURCE=~/ebuild/${APP}-${VERSION}.tar.gz
+
+
+# Update version numbers automatically - so you don't have to
+sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' Makefile debian.sh rpm.sh arch.sh puppy.sh
+sed -i 's/Version: '${PREV_VERSION}'/Version: '${VERSION}'/g' rpmpackage/${APP}.spec
+sed -i 's/Release: '${RELEASE}'/Release: '${RELEASE}'/g' rpmpackage/${APP}.spec
+sed -i 's/pkgrel='${RELEASE}'/pkgrel='${RELEASE}'/g' archpackage/PKGBUILD
+sed -i 's/pkgver='${PREV_VERSION}'/pkgver='${VERSION}'/g' archpackage/PKGBUILD
+sed -i "s/-${PREV_VERSION}-/-${VERSION}-/g" puppypackage/pet.specs
+sed -i "s/|${PREV_VERSION}|/|${VERSION}|/g" puppypackage/pet.specs
+
+# create the source code in the SOURCES directory
+make clean
+mkdir -p ~/ebuild
+rm -f ${SOURCE}
+mv ../${APP} ../${APP}-${VERSION}
+tar -cvzf ${SOURCE} ../${APP}-${VERSION} --exclude-vcs
+# rename the root directory without the version number
+mv ../${APP}-${VERSION} ../${APP}
+

+ 5 - 0
generate.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+# Generates packaging for fin
+
+packagemonkey -n "fin" --cmd --dir "." -l "gpl3" -e "Bob Mottram (4096 bits) <bob@robotics.uk.to>" --brief "Command line personal finances manager" --desc "Keeping track of personal finances is an incredibly boring task, and if you don't have much money then juggling it can be tricky. When looking at the existing software out there to manage accounts it's frequently highly complex and top heavy. Fin - an abbreviation of \"financials\" - is an attempt to do the opposite of what most accounting software does, and that's to make things incredibly simple and quick. Logging a transaction or viewing your current balance should take no more than a few seconds. This means less time wasted on bureaucracy and more time spent on what you really want to be doing. Fin can import and export to CSV files, Emacs org mode tables and GnuCash." --homepage "https://github.com/fuzzgun/fin" --repository "https://github.com/fuzzgun/fin.git" --section "utils" --version "1.51" --categories "Utility/ConsoleOnly" --compile "-lsqlite3" --builddeb "libsqlite3-dev" --dependsdeb "gnuplot, bcrypt, sqlite3" --buildarch "sqlite" --dependsarch "gnuplot, sqlite" --dependspuppy "sqlite3_3.7.9, gnuplot_4.4.3, bcrypt-1.1"

+ 58 - 0
puppy.sh

@@ -0,0 +1,58 @@
+#!/bin/bash
+
+APP=fin
+PREV_VERSION=1.51
+VERSION=1.51
+RELEASE=1
+BUILDDIR=~/petbuild
+CURRDIR=`pwd`
+PROJECTDIR=${BUILDDIR}/${APP}-${VERSION}-${RELEASE}
+
+# Update version numbers automatically - so you don't have to
+sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' Makefile debian.sh rpm.sh arch.sh ebuild.sh
+sed -i 's/Version: '${PREV_VERSION}'/Version: '${VERSION}'/g' rpmpackage/${APP}.spec
+sed -i 's/Release: '${RELEASE}'/Release: '${RELEASE}'/g' rpmpackage/${APP}.spec
+sed -i 's/pkgrel='${RELEASE}'/pkgrel='${RELEASE}'/g' archpackage/PKGBUILD
+sed -i 's/pkgver='${PREV_VERSION}'/pkgver='${VERSION}'/g' archpackage/PKGBUILD
+sed -i "s/-${PREV_VERSION}-/-${VERSION}-/g" puppypackage/pet.specs
+sed -i "s/|${PREV_VERSION}|/|${VERSION}|/g" puppypackage/pet.specs
+
+
+# Make directories within which the project will be built
+mkdir -p ${BUILDDIR}
+mkdir -p ${PROJECTDIR}
+
+# Build the project
+make clean
+make
+make install -B DESTDIR=${PROJECTDIR}
+
+# create directories specific to puppy
+mkdir ${PROJECTDIR}/usr
+mkdir ${PROJECTDIR}/usr/local
+mkdir ${PROJECTDIR}/usr/local/bin
+
+# copy anything in /usr/bin into /usr/local/bin
+cp ${PROJECTDIR}/usr/bin/* ${PROJECTDIR}/usr/local/bin/
+
+# Copy the spec file into the build directory
+cp puppypackage/fin-1.51.pet.specs ${PROJECTDIR}
+
+# Compress the build directory
+cd ${BUILDDIR}
+tar -c -f {APP}-${VERSION}-${RELEASE}.tar .
+sync
+gzip {APP}-${VERSION}-${RELEASE}.tar
+mv {APP}-${VERSION}-${RELEASE}.tar.gz ${CURRDIR}/puppypackage
+cd ${CURRDIR}/puppypackage
+
+# Create the PET package
+MD5SUM="`md5sum {APP}-${VERSION}-${RELEASE}.tar.gz | cut -f 1 -d ' '`"
+echo -n "$MD5SUM" >> {APP}-${VERSION}-${RELEASE}.tar.gz
+sync
+mv -f {APP}-${VERSION}-${RELEASE}.tar.gz ${APP}-${VERSION}-${RELEASE}.pet
+sync
+cd ${CURRDIR}
+
+# Remove the temporary build directory
+rm -fr ${BUILDDIR}

+ 11 - 10
rpm.sh

@@ -3,18 +3,24 @@
 APP=fin
 PREV_VERSION=1.51
 VERSION=1.51
+RELEASE=1
 SOURCEDIR=.
 ARCH_TYPE=`uname -m`
 CURRDIR=`pwd`
-SOURCE=~/rpmbuild/SOURCES/${APP}_${VERSION}.orig.tar.gz
+SOURCE=~/rpmbuild/SOURCES/${APP}-${VERSION}.orig.tar.gz
 
-#update version numbers automatically - so you don't have to
-sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' Makefile debian.sh
+
+# Update version numbers automatically - so you don't have to
+sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' Makefile debian.sh arch.sh puppy.sh ebuild.sh
 sed -i 's/Version: '${PREV_VERSION}'/Version: '${VERSION}'/g' rpmpackage/${APP}.spec
-sed -i 's/"'${PREV_VERSION}'"/"'${VERSION}'"/g' src/globals.h 
+sed -i 's/Release: '${RELEASE}'/Release: '${RELEASE}'/g' rpmpackage/${APP}.spec
+sed -i 's/pkgrel='${RELEASE}'/pkgrel='${RELEASE}'/g' archpackage/PKGBUILD
+sed -i 's/pkgver='${PREV_VERSION}'/pkgver='${VERSION}'/g' archpackage/PKGBUILD
+sed -i "s/-${PREV_VERSION}-/-${VERSION}-/g" puppypackage/pet.specs
+sed -i "s/|${PREV_VERSION}|/|${VERSION}|/g" puppypackage/pet.specs
 
 sudo yum groupinstall "Development Tools"
-sudo yum install rpmdevtools sqlite sqlite-devel bcrypt gnuplot
+sudo yum install rpmdevtools
 
 # setup the rpmbuild directory tree
 rpmdev-setuptree
@@ -41,8 +47,3 @@ cd ${CURRDIR}
 mkdir -p rpmpackage/${ARCH_TYPE}
 cp -r ~/rpmbuild/RPMS/${ARCH_TYPE}/${APP}* rpmpackage/${ARCH_TYPE}
 cp -r ~/rpmbuild/SRPMS/${APP}* rpmpackage
-
-echo ---------------------------------------------------------
-echo RPM files can be found in the rpmpackage directory
-echo under architecture subdirectories.
-echo ---------------------------------------------------------

+ 11 - 28
rpmpackage/fin.spec

@@ -1,34 +1,21 @@
 Name: fin
 Version: 1.51
 Release: 1%{?dist}
-Summary: The command line personal finances manager
+Summary: Command line personal finances manager
 License: GPL3
-URL: https://github.com/fuzzgun/%{name}
-Packager: Bob Mottram <bob@robotics.uk.to>   
-Source0: https://launchpad.net/%{name}/trunk/v%{version}/+download/%{name}_%{version}.orig.tar.gz
-Group: Applications/Utilities
-
-Requires: bcrypt gnuplot
-%if 0%{?mandriva_version}
-BuildRequires: libsqlite3-devel
-Requires: sqlite3
-%else
-BuildRequires: sqlite-devel
-Requires: sqlite
-%endif
+URL: https://github.com/fuzzgun/fin
+Packager: Bob Mottram (4096 bits) <bob@robotics.uk.to>
+Source0: http://yourdomainname.com/src/%{name}_%{version}.orig.tar.gz
+Group: Utility/ConsoleOnly
 
 %description
 Keeping track of personal finances is an incredibly boring task, and if you
-don't have much money then juggling it can be tricky.  When looking at the
+don't have much money then juggling it can be tricky. When looking at the
 existing software out there to manage accounts it's frequently highly
-complex and top heavy.  Fin - an abbreviation of "financials" - is an
+complex and top heavy. Fin - an abbreviation of "financials" - is an
 attempt to do the opposite of what most accounting software does, and
-that's to make things incredibly simple and quick.  Logging a transaction
-or viewing your current balance should take no more than a few seconds.
-
-This means less time wasted on bureaucracy and more time spent on what you
-really want to be doing.  Fin can import and export to CSV files, Emacs
-org mode tables and GnuCash.
+that's to make things incredibly simple and quick. Logging a transaction or
+viewing your current balance should take no more than a few sec
 
 %prep
 %setup -q
@@ -38,7 +25,6 @@ org mode tables and GnuCash.
 make %{?_smp_mflags}
 
 %install
-# Create some directories to install into
 rm -rf %{buildroot}
 mkdir -p %{buildroot}
 mkdir -p %{buildroot}/etc
@@ -48,9 +34,8 @@ mkdir -p %{buildroot}/usr/bin
 mkdir -p %{buildroot}/usr/share
 mkdir -p %{buildroot}/usr/share/man
 mkdir -p %{buildroot}/usr/share/man/man1
-
 # Make install but to the RPM BUILDROOT directory
-make install DESTDIR=%{buildroot}
+make install -B DESTDIR=%{buildroot}
 
 %files
 %doc README.md LICENSE
@@ -59,7 +44,5 @@ make install DESTDIR=%{buildroot}
 %{_mandir}/man1/*
 
 %changelog
-* Sun Jun 02 2013  Bob Mottram <bob@robotics.uk.to>
-- A better spec file created
-* Fri Jan 20 2012  Bob Mottram <bob@robotics.uk.to>
+* Sun Jun 30 2013  Bob Mottram (4096 bits) <bob@robotics.uk.to>
 - Spec file created