Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source packaging fixes and RPM build support #592

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3eed273
Add RPM build specfile and source distribution targets.
Rudd-O Aug 12, 2016
66c4b33
RPM: Ensure that the PATH includes lrelease in Fedora.
Rudd-O Jan 7, 2018
fb0b86b
Specfile updated to have the right PATH upon install.
Rudd-O Jan 7, 2018
a4ce983
Work around broken build system.
Rudd-O Jan 8, 2018
3aa8bd3
Add rsync dependency.
Rudd-O Jan 8, 2018
795cde9
Remove echoes.
Rudd-O Jan 8, 2018
2755b7d
Install desktop files and fix destdir mess.
Rudd-O Jan 8, 2018
4fa6dde
Fix build and remove workaround.
Rudd-O Jan 8, 2018
5152329
Fix makefile typo.
Rudd-O Jan 8, 2018
53b5164
Use libdir.
Rudd-O Jan 8, 2018
2bdf249
Fix files list.
Rudd-O Jan 8, 2018
6452925
Merge remote-tracking branch 'goatpig/master'
Rudd-O Jun 29, 2018
060b2f5
Reduce diff compared to upstream.
Rudd-O Jun 29, 2018
89a30fb
lrelease in Fedora is lrelease-qt4
Rudd-O Jun 29, 2018
dad884c
Test commit.
Rudd-O Jun 29, 2018
34e4899
Jenkinsfile.
Rudd-O Mar 14, 2019
77f614f
force generic make.
Rudd-O Mar 14, 2019
abbafac
Fix.
Rudd-O Mar 14, 2019
e5f784c
Force srpm step.
Rudd-O Mar 14, 2019
471a2ba
Explicit checkout step null.
Rudd-O Mar 14, 2019
10cc36a
Try fix.
Rudd-O Mar 14, 2019
612a99b
Try fix 2.
Rudd-O Mar 14, 2019
8a59cc6
Try fix 2.
Rudd-O Mar 14, 2019
62510c4
Try fix 4.
Rudd-O Mar 14, 2019
7d99d6f
Fix.o
Rudd-O Mar 14, 2019
d59c2c2
autogen.
Rudd-O Mar 14, 2019
fde300c
autogen 2.
Rudd-O Mar 14, 2019
4318970
Hardcode python version so configure does not fail in Fedora 29.
Rudd-O Mar 14, 2019
9d61900
Python version configure.
Rudd-O Mar 14, 2019
2e773d7
Override python interpreter in specfile.
Rudd-O Mar 14, 2019
b3fca28
Override python interpreter in Jenkinsfile.
Rudd-O Mar 14, 2019
9532866
Fix way in which python is injected into RPM build.
Rudd-O Mar 14, 2019
485f8eb
srpm_deps
Rudd-O Mar 15, 2019
2bbb2d4
Merge remote-tracking branch 'goatpig/master' into update
Rudd-O Jun 12, 2019
afce879
Ensure the Segwit addresses are included in the Makefile so that targ…
Rudd-O Jun 12, 2019
728bdb6
RPM builds require an explicit shebang.
Rudd-O Jun 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,9 @@ _CppBlockUtils.*
/cppForSwig/guardian/x64*
/cppForSwig/x64*
/cppForSwig/LMDB_Win/x64*
/cppForSwig/x64/*.*
/cppForSwig/x64/*.*

dist
BitcoinArmory-*.tar.gz
BitcoinArmory.spec
BitcoinArmory-*.rpm
2 changes: 1 addition & 1 deletion ArmoryQt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/python
#!/usr/bin/python2
# -*- coding: UTF-8 -*-
##############################################################################
# #
Expand Down
45 changes: 45 additions & 0 deletions BitcoinArmory.spec.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# disable debug package, otherwise nasty build error in fedora >= 23
%global debug_package %{nil}

%define mybuildnumber %{?build_number}%{?!build_number:1}

Name: BitcoinArmory
Version: @PACKAGE_VERSION@
Release: %{mybuildnumber}%{?dist}
Summary: A high-security Bitcoin wallet
Group: Applications/Financial
License: MIT
Source0: bitcoinarmory-%{version}.tar.gz

BuildRequires: python2-twisted, python2-psutil, swig, python2-devel, gcc-c++, PyQt4-devel, qt-devel, rsync
Requires: PyQt4, python-twisted, python-psutil
%description
This is a local full node implementation of an advanced Bitcoin wallet.

%prep
%setup -q -n bitcoinarmory-%{version}


%build
export PATH=/usr/lib64/qt4/bin:/usr/lib/qt4/bin:"$PATH"
export PYTHON=%{_bindir}/python2
%configure
%make_build


%install
mkdir -p "%{buildroot}"/usr/share/applications
export PATH=/usr/lib64/qt4/bin:/usr/lib/qt4/bin:"$PATH"
export PYTHON=%{_bindir}/python2
%make_install


%files
%defattr(-, root, root)
%{_datadir}/applications/*.desktop
%{_includedir}/*.h
%{_libdir}/libfcgi.*
%{_libdir}/libCppBlockUtils.*
%{_prefix}/lib/armory
%{_datadir}/armory/*
%attr(0755, root, root) %{_bindir}/*
11 changes: 11 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// https://github.com/Rudd-O/shared-jenkins-libraries
@Library('shared-jenkins-libraries@master') _


genericFedoraRPMPipeline(
null,
{
sh 'cd src && ./autogen.sh && PYTHON=/usr/bin/python2 ./configure --prefix=/usr && make srpm'
},
['autoconf', 'automake', 'libtool', 'gcc-c++', 'swig', 'python2-psutil', 'PyQt4-devel'],
)
18 changes: 16 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ EXTRA_DIST = *.py *.md LICENSE LICENSE-ATI LICENSE-MIT \
nginx_example.conf imgList.xml autogen.sh \
armoryengine/*.py ui/*.py \
img/* lang/* dpkgfiles/* \
windowsbuild/* linuxbuild/* osxbuild/*
windowsbuild/* linuxbuild/* osxbuild/* BitcoinArmory.spec

ACLOCAL_AMFLAGS = -I m4

lrelease:
if HAVE_GUI
lrelease lang/*.ts
$(HAVE_LRELEASE) lang/*.ts
endif

qrc_img_resources.py: imgList.xml
Expand Down Expand Up @@ -66,10 +66,16 @@ endif

# Skip Linux-specific steps on OSX.
if ! BUILD_DARWIN
# Unfuck broken build system that, upon make install, incorrectly
# regenerates files with DESTDIR instead of prefix.
# Who the hell uses autotools in 2017?
if HAVE_GUI
rsync -rupE --exclude="img/.DS_Store" img $(DESTDIR)$(prefix)/share/armory/
sed "s: /usr: $(prefix):g" < dpkgfiles/armory > $(DESTDIR)$(prefix)/bin/armory
chmod +x $(DESTDIR)$(prefix)/bin/armory
mkdir -p $(DESTDIR)$(datadir)/applications
chmod 0755 $(DESTDIR)$(datadir)/applications
for f in armory.desktop armoryoffline.desktop armorytestnet.desktop ; do sed "s:/usr/local/bin:$(bindir):g" < dpkgfiles/$$f > $(DESTDIR)$(datadir)/applications/$$f ; chmod 0644 $(DESTDIR)$(datadir)/applications/$$f ; done
endif
endif

Expand All @@ -84,3 +90,11 @@ clean-local:
rm -f CppBlockUtils.py
rm -f _CppBlockUtils.so
rm -f CppBlockUtils.pyc

srpm: dist
mkdir -p dist
tmpdir=`mktemp -d` ; rpmbuild --define "_topdir $$tmpdir" -ts bitcoinarmory-$(PACKAGE_VERSION).tar.gz && { mv -f "$$tmpdir"/SRPMS/* . ; } ; rm -rf "$$tmpdir"

rpm: dist
mkdir -p dist
tmpdir=`mktemp -d` ; rpmbuild --define "_topdir $$tmpdir" -ta bitcoinarmory-$(PACKAGE_VERSION).tar.gz && { mv -f "$$tmpdir"/SRPMS/* "$$tmpdir"/RPMS/*/* . ; } ; rm -rf "$$tmpdir"
10 changes: 6 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ AC_CHECK_PROG([HAVE_PYRCC4], [pyrcc4], [yes], [no])
AS_IF([test $HAVE_PYRCC4 == yes], [],
[AC_MSG_ERROR([missing pyrcc4 in path, make sure pyqt4-dev-tools is installed])])

AC_CHECK_PROG([HAVE_LRELEASE], [lrelease], [yes], [no])
AS_IF([test $HAVE_LRELEASE == yes], [],
[AC_MSG_ERROR([missing lrelease in path, make sure qt4-linguist-tools is installed])])
AC_CHECK_PROGS([HAVE_LRELEASE], [lrelease lrelease-qt4], [no])
AS_IF([test $HAVE_LRELEASE == no],
[AC_MSG_ERROR([missing lrelease in path, make sure qt4-linguist-tools is installed])],
[])

fi

Expand Down Expand Up @@ -164,7 +165,8 @@ AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])

AC_CONFIG_FILES(Makefile
cppForSwig/Makefile
cppForSwig/lmdb/Makefile)
cppForSwig/lmdb/Makefile
BitcoinArmory.spec)

AM_CONDITIONAL([BUILD_TESTS], [test "x$want_tests" = "xyes"])
if test "x$want_tests" = "xyes"; then
Expand Down
9 changes: 8 additions & 1 deletion cppForSwig/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ if HAVE_CLANG
SWIG_FLAGS += -D__CLANG__
endif

EXTRA_DIST = CppBlockUtils.i CppBlockUtils.py

INCLUDE_FILES = UniversalTimer.h BinaryData.h lmdb_wrapper.h \
BtcUtils.h DBUtils.h BlockObj.h BlockUtils.h EncryptionUtils.h \
BtcWallet.h LedgerEntry.h ScrAddrObj.h Blockchain.h \
Expand All @@ -31,7 +33,12 @@ INCLUDE_FILES = UniversalTimer.h BinaryData.h lmdb_wrapper.h \
FcgiMessage.h BlockDataManagerConfig.h \
Transactions.h Script.h Signer.h nodeRPC.h JSON_codec.h \
ReentrantLock.h StringSockets.h log.h OS_TranslatePath.h \
TransactionBatch.h BlockchainScanner_Super.h SigHashEnum.h TxEvalState.h
TransactionBatch.h BlockchainScanner_Super.h SigHashEnum.h TxEvalState.h \
make_unique.h TxOutScrRef.h bdmenums.h DbHeader.h SocketIncludes.h \
PartialMerkle.h util.h WalletManager.h SwigClient.h Wallets.h \
CoinSelection.h LedgerEntryData.h ThreadSafeClasses.h \
Win_TranslatePath.h ScriptRecipient.h \
bech32/ref/c++/bech32.h bech32/ref/c++/segwit_addr.h

DB_SOURCE_FILES = UniversalTimer.cpp BinaryData.cpp lmdb_wrapper.cpp \
BtcUtils.cpp DBUtils.cpp BlockObj.cpp BlockUtils.cpp EncryptionUtils.cpp \
Expand Down