From 2af86c8296e0c577f8ac48a56e9a3582ddd87473 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 23 Jul 2013 16:04:44 +0100 Subject: [PATCH] Improving the Ebuild --- Makefile | 56 ++++++++++++----------- archpackage/PKGBUILD | 2 +- debian/control | 2 +- debian/rules | 3 +- ebuildpackage/pybitmessage-0.3.4-1.ebuild | 20 ++++++-- generate.sh | 2 +- puppy.sh | 2 +- puppypackage/pybitmessage-0.3.4.pet.specs | 2 +- rpmpackage/pybitmessage.spec | 2 +- slack.sh | 2 +- 10 files changed, 53 insertions(+), 40 deletions(-) diff --git a/Makefile b/Makefile index b9a85ff7..adda5583 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ APP=pybitmessage VERSION=0.3.4 RELEASE=1 ARCH_TYPE=`uname -m` +PREFIX?=/usr/local all: debug: @@ -9,34 +10,35 @@ source: tar -cvzf ../${APP}_${VERSION}.orig.tar.gz ../${APP}-${VERSION} --exclude-vcs install: mkdir -p ${DESTDIR}/usr - mkdir -p ${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 - install -m 644 man/${APP}.1.gz ${DESTDIR}/usr/share/man/man1 - mkdir -m 755 -p ${DESTDIR}/usr/share/${APP} - mkdir -m 755 -p ${DESTDIR}/usr/share/applications - mkdir -m 755 -p ${DESTDIR}/usr/share/pixmaps - mkdir -m 755 -p ${DESTDIR}/usr/share/icons - mkdir -m 755 -p ${DESTDIR}/usr/share/icons/hicolor - mkdir -m 755 -p ${DESTDIR}/usr/share/icons/hicolor/scalable - mkdir -m 755 -p ${DESTDIR}/usr/share/icons/hicolor/scalable/apps - mkdir -m 755 -p ${DESTDIR}/usr/share/icons/hicolor/24x24 - mkdir -m 755 -p ${DESTDIR}/usr/share/icons/hicolor/24x24/apps - install -m 644 desktop/${APP}.desktop ${DESTDIR}/usr/share/applications/${APP}.desktop - install -m 644 desktop/icon24.png ${DESTDIR}/usr/share/icons/hicolor/24x24/apps/${APP}.png - cp -rf src/* ${DESTDIR}/usr/share/${APP} - echo '#!/bin/sh' > ${DESTDIR}/usr/bin/${APP} - echo 'cd /usr/share/pybitmessage' >> ${DESTDIR}/usr/bin/${APP} - echo 'LD_LIBRARY_PATH="/opt/openssl-compat-bitcoin/lib/" exec python2 bitmessagemain.py' >> ${DESTDIR}/usr/bin/${APP} - chmod +x ${DESTDIR}/usr/bin/${APP} + mkdir -p ${DESTDIR}${PREFIX} + mkdir -p ${DESTDIR}${PREFIX}/bin + mkdir -m 755 -p ${DESTDIR}${PREFIX}/share + mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/man + mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/man/man1 + install -m 644 man/${APP}.1.gz ${DESTDIR}${PREFIX}/share/man/man1 + mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/${APP} + mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/applications + mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/pixmaps + mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/icons + mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/icons/hicolor + mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable + mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps + mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/icons/hicolor/24x24 + mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/icons/hicolor/24x24/apps + install -m 644 desktop/${APP}.desktop ${DESTDIR}${PREFIX}/share/applications/${APP}.desktop + install -m 644 desktop/icon24.png ${DESTDIR}${PREFIX}/share/icons/hicolor/24x24/apps/${APP}.png + cp -rf src/* ${DESTDIR}${PREFIX}/share/${APP} + echo '#!/bin/sh' > ${DESTDIR}${PREFIX}/bin/${APP} + echo 'cd ${PREFIX}/share/pybitmessage' >> ${DESTDIR}${PREFIX}/bin/${APP} + echo 'LD_LIBRARY_PATH="/opt/openssl-compat-bitcoin/lib/" exec python2 bitmessagemain.py' >> ${DESTDIR}${PREFIX}/bin/${APP} + chmod +x ${DESTDIR}${PREFIX}/bin/${APP} uninstall: - rm -f /usr/share/man/man1/${APP}.1.gz - rm -rf /usr/share/${APP} - rm -f /usr/bin/${APP} - rm -f /usr/share/applications/${APP}.desktop - rm -f /usr/share/icons/hicolor/scalable/apps/${APP}.svg - /usr/share/pixmaps/${APP}.svg + rm -f ${PREFIX}/share/man/man1/${APP}.1.gz + rm -rf ${PREFIX}/share/${APP} + rm -f ${PREFIX}/bin/${APP} + rm -f ${PREFIX}/share/applications/${APP}.desktop + rm -f ${PREFIX}/share/icons/hicolor/scalable/apps/${APP}.svg + ${PREFIX}/share/pixmaps/${APP}.svg clean: rm -f ${APP} \#* \.#* gnuplot* *.png debian/*.substvars debian/*.log rm -fr deb.* debian/${APP} rpmpackage/${ARCH_TYPE} diff --git a/archpackage/PKGBUILD b/archpackage/PKGBUILD index e9ab0f74..e36c1a11 100644 --- a/archpackage/PKGBUILD +++ b/archpackage/PKGBUILD @@ -27,5 +27,5 @@ build() { } package() { cd "$srcdir/$pkgname-$pkgver" - make DESTDIR="$pkgdir/" install + make DESTDIR="$pkgdir/" PREFIX="/usr" install } diff --git a/debian/control b/debian/control index d9ed8704..b2ec3268 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Maintainer: Bob Mottram (4096 bits) Build-Depends: debhelper (>= 9.0.0) Standards-Version: 3.9.4 Homepage: https://github.com/Bitmessage/PyBitmessage -Vcs-Git: https://github.com/fuzzgun/fin.git +Vcs-Git: https://github.com/fuzzgun/packagemonkey.git Package: pybitmessage Section: mail diff --git a/debian/rules b/debian/rules index 233679ca..5b29d243 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,7 @@ #!/usr/bin/make -f APP=pybitmessage +PREFIX=/usr build: build-stamp make build-arch: build-stamp @@ -20,7 +21,7 @@ install: build clean dh_testroot dh_prep dh_installdirs - ${MAKE} install -B DESTDIR=${CURDIR}/debian/${APP} + ${MAKE} install -B DESTDIR=${CURDIR}/debian/${APP} PREFIX=/usr binary-indep: build install dh_testdir dh_testroot diff --git a/ebuildpackage/pybitmessage-0.3.4-1.ebuild b/ebuildpackage/pybitmessage-0.3.4-1.ebuild index 20f056e4..fba11f74 100755 --- a/ebuildpackage/pybitmessage-0.3.4-1.ebuild +++ b/ebuildpackage/pybitmessage-0.3.4-1.ebuild @@ -1,22 +1,32 @@ # $Header: $ -EAPI=4 +EAPI=5 +inherit git-2 python-r1 + +PYTHON_COMPAT=( python2_7 ) +PYTHON_REQ_USE="sqlite" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" DESCRIPTION="Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide "non-content" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs." HOMEPAGE="https://github.com/Bitmessage/PyBitmessage" -SRC_URI="${PN}/${P}.tar.gz" +EGIT_REPO_URI="https://github.com/fuzzgun/packagemonkey.git" LICENSE="MIT" SLOT="0" KEYWORDS="x86" -RDEPEND="dev-libs/popt" -DEPEND="${RDEPEND}" +DEPEND="dev-libs/popt + ${PYTHON_DEPS}" +RDEPEND="${DEPEND} + dev-libs/openssl + dev-python/PyQt4[]" src_configure() { econf --with-popt } +src_compile() { :; } + src_install() { - emake DESTDIR="${D}" install + emake DESTDIR="${D}" PREFIX="/usr" install # Install README and (Debian) changelog dodoc README.md debian/changelog } diff --git a/generate.sh b/generate.sh index 8489f024..7aa46e75 100755 --- a/generate.sh +++ b/generate.sh @@ -4,4 +4,4 @@ rm -f Makefile rpmpackage/*.spec -packagemonkey -n "PyBitmessage" --version "0.3.4" --dir "." -l "mit" -e "Bob Mottram (4096 bits) " --brief "Send encrypted messages" --desc "Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide \"non-content\" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs." --homepage "https://github.com/Bitmessage/PyBitmessage" --section "mail" --categories "Office/Email" --dependsdeb "python (>= 2.7.0), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, gst123" --dependsrpm "python, PyQt4, openssl-compat-bitcoin-libs, gst123" --mainscript "bitmessagemain.py" --librarypath "/opt/openssl-compat-bitcoin/lib/" --suggestsdeb "libmessaging-menu-dev" --dependspuppy "openssl, python-qt4, sqlite3, sqlite3-dev, python-openssl, python-sip, gst123" --dependsarch "python2, qt4, python2-pyqt4, sqlite, openssl, gst123" --suggestsarch "python2-gevent" --pythonversion 2 +packagemonkey -n "PyBitmessage" --version "0.3.4" --dir "." -l "mit" -e "Bob Mottram (4096 bits) " --brief "Send encrypted messages" --desc "Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide \"non-content\" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs." --homepage "https://github.com/Bitmessage/PyBitmessage" --section "mail" --categories "Office/Email" --dependsdeb "python (>= 2.7.0), openssl, python-qt4, libqt4-dev (>= 4.8.0), python-qt4-dev, sqlite3, libsqlite3-dev, gst123" --dependsrpm "python, PyQt4, openssl-compat-bitcoin-libs, gst123" --mainscript "bitmessagemain.py" --librarypath "/opt/openssl-compat-bitcoin/lib/" --suggestsdeb "libmessaging-menu-dev" --dependspuppy "openssl, python-qt4, sqlite3, sqlite3-dev, python-openssl, python-sip, gst123" --dependsarch "python2, qt4, python2-pyqt4, sqlite, openssl, gst123" --suggestsarch "python2-gevent" --pythonversion 2 --dependsebuild "dev-libs/openssl, dev-python/PyQt4[${PYTHON_USEDEP}]" --buildebuild "\${PYTHON_DEPS}" --pythonreq "sqlite" diff --git a/puppy.sh b/puppy.sh index dd54ecc9..efe1d7da 100755 --- a/puppy.sh +++ b/puppy.sh @@ -27,7 +27,7 @@ mkdir -p ${PROJECTDIR} # Build the project make clean make -make install -B DESTDIR=${PROJECTDIR} +make install -B DESTDIR=${PROJECTDIR} PREFIX=/usr # Alter the desktop file categories sed -i "s/Categories=Office;Email;/Categories=Internet;mailnews;/g" ${PROJECTDIR}/usr/share/applications/${APP}.desktop diff --git a/puppypackage/pybitmessage-0.3.4.pet.specs b/puppypackage/pybitmessage-0.3.4.pet.specs index 42d99ac3..4bcf119b 100644 --- a/puppypackage/pybitmessage-0.3.4.pet.specs +++ b/puppypackage/pybitmessage-0.3.4.pet.specs @@ -1 +1 @@ -pybitmessage-0.3.4-1|PyBitmessage|0.3.4|1|Internet;mailnews;|5.3M||pybitmessage-0.3.4-1.pet|+openssl,+python-qt4,+sqlite3,+sqlite3-dev,+python-openssl,+python-sip,+gst123|Send encrypted messages|ubuntu|precise|5| +pybitmessage-0.3.4-1|PyBitmessage|0.3.4|1|Internet;mailnews;|3.9M||pybitmessage-0.3.4-1.pet|+openssl,+python-qt4,+sqlite3,+sqlite3-dev,+python-openssl,+python-sip,+gst123|Send encrypted messages|ubuntu|precise|5| diff --git a/rpmpackage/pybitmessage.spec b/rpmpackage/pybitmessage.spec index c9254dec..9c12661a 100644 --- a/rpmpackage/pybitmessage.spec +++ b/rpmpackage/pybitmessage.spec @@ -48,7 +48,7 @@ mkdir -p %{buildroot}/usr/share/pixmaps mkdir -p %{buildroot}/usr/share/icons/hicolor/scalable mkdir -p %{buildroot}/usr/share/icons/hicolor/scalable/apps # Make install but to the RPM BUILDROOT directory -make install -B DESTDIR=%{buildroot} +make install -B DESTDIR=%{buildroot} PREFIX=/usr %files %doc README.md LICENSE diff --git a/slack.sh b/slack.sh index cc71e1f3..5d826e0b 100755 --- a/slack.sh +++ b/slack.sh @@ -28,7 +28,7 @@ mkdir -p ${PROJECTDIR} # Build the project make clean make -make install -B DESTDIR=${PROJECTDIR} +make install -B DESTDIR=${PROJECTDIR} PREFIX=/usr # Copy the slack-desc and doinst.sh files into the build install directory mkdir ${PROJECTDIR}/install