# Dogecoin RPM spec for Fedora # Use the other spec file for Enterprise Linux %define _hardened_build 1 %global selinux_variants mls strict targeted Name: dogecoin Version: 1.7.0 Release: 3 Summary: Peer-to-peer digital currency Group: Applications/System License: MIT URL: http://dogecoin.com/ #Source0: https://github.com/dogecoin/%{name}/archive/v%{version}.tar.gz Source0: v%{version}.tar.gz Source3: dogecoin.init Source4: dogecoin.te Source5: dogecoin.fc Source6: dogecoin.if Patch1: dogecoin-1.4.1-boostmt.patch Patch3: dogecoin-1.7.0-fhs-paths.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) # seriously! BuildRequires: git BuildRequires: qt-devel >= 1:4.6 qrencode-devel openssl-compat-bitcoin-devel miniupnpc-devel protobuf-devel BuildRequires: desktop-file-utils autoconf automake BuildRequires: checkpolicy, selinux-policy-devel, selinux-policy-doc %if 0%{?rhel} >= 7 || 0%{?fedora} BuildRequires: boost-devel libdb4-cxx-devel BuildRequires: libdb-cxx-devel %else BuildRequires: boost-compat-bitcoin-devel db4-devel %endif Requires: openssl-compat-bitcoin >= 1.0.1f %package cli Summary: Peer-to-peer digital currency Requires: openssl-compat-bitcoin >= 1.0.1f %package server Summary: Peer-to-peer digital currency Requires(pre): shadow-utils Requires(post): chkconfig Requires(post): /usr/sbin/semodule, /sbin/restorecon, /sbin/fixfiles Requires(preun): chkconfig # This is for /sbin/service Requires(preun): initscripts Requires(postun): initscripts Requires(postun): /usr/sbin/semodule, /sbin/restorecon, /sbin/fixfiles Requires: selinux-policy Requires: policycoreutils-python Requires: boost >= 1.47.0 %if 0%{?fedora} >= 18 Requires: openssl-compat-bitcoin-libs >= 1.0.0j %else Requires: openssl-compat-bitcoin >= 1.0.0j %endif Requires: dogecoin-cli%{_isa} = %{version} %description Dogecoin is an experimental new digital currency that enables instant payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. Dogecoin is also the name of the open source software which enables the use of this currency. This package provides Dogecoin, a user-friendly wallet manager for personal use. %description cli Bitcoin is an experimental new digital currency that enables instant payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. This package provides dogecoin-cli, a utility to communicate with and control a Bitcoin server via its RPC protocol. %description server Dogecoin is an experimental new digital currency that enables instant payments to anyone, anywhere in the world. Dogecoin uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. This package provides dogecoind, a wallet server and command line tool for manipulating a remote dogecoind server. %prep %setup -q -n %{name}-%{version} # Strip OS X resource forks that upstream accidentally bundled find . -name "._*" -delete %if 0%{?fedora} <= 19 %patch1 -p1 %endif %patch3 -p1 # Prep SELinux policy mkdir SELinux cp -p %{SOURCE4} %{SOURCE5} %{SOURCE6} SELinux %build # Build dogecoin GUI #test -d /usr/lib64/qt4/bin && \ # QMAKE=/usr/lib64/qt4/bin/qmake || \ # QMAKE=/usr/lib/qt4/bin/qmake ./autogen.sh %if 0%{?rhel} >= 7 || 0%{?fedora} %{configure} --with-incompatible-bdb \ PKG_CONFIG_PATH=/opt/openssl-compat-bitcoin/lib/pkgconfig \ LIBS=-Wl,-rpath,/opt/openssl-compat-bitcoin/lib %else %ifarch x86_64 %configure --with-incompatible-bdb \ --with-boost=/opt/boost-compat-bitcoin \ PKG_CONFIG_PATH=/opt/openssl-compat-bitcoin/lib/pkgconfig \ LIBS=-Wl,-rpath,/opt/openssl-compat-bitcoin/lib,-rpath,/opt/boost-compat-bitcoin/lib64 %else %configure --with-incompatible-bdb \ --with-boost=/opt/boost-compat-bitcoin \ PKG_CONFIG_PATH=/opt/openssl-compat-bitcoin/lib/pkgconfig \ LIBS=-Wl,-rpath,/opt/openssl-compat-bitcoin/lib,-rpath,/opt/boost-compat-bitcoin/lib %endif %endif make %{?_smp_mflags} CFLAGS="%{optflags}" # Build SELinux policy pushd SELinux for selinuxvariant in %{selinux_variants} do # FIXME: Create and debug SELinux policy make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile mv dogecoin.pp dogecoin.pp.${selinuxvariant} make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean done popd # Fix pixmaps pushd share/pixmaps/ for file in `ls bitcoin*`; do new=`echo $file |sed 's/bit/doge/g'` mv $file $new done popd %install make install DESTDIR=%{buildroot} #rm -rf %{buildroot} #mkdir %{buildroot} cp contrib/debian/examples/bitcoin.conf dogecoin.conf.example ## Install dogecoin GUI #install -D -m755 -p dogecoin-qt %{buildroot}%{_bindir}/dogecoin-qt # TODO: Upstream puts bitcoind in the wrong directory. Need to fix the # upstream Makefiles to relocate it. mkdir -p -m 755 %{buildroot}%{_sbindir} mv %{buildroot}%{_bindir}/dogecoind %{buildroot}%{_sbindir}/dogecoind mkdir -p -m 755 %{buildroot}%{_datadir}/pixmaps install -D -m644 -p share/pixmaps/*.{png,xpm,ico} %{buildroot}%{_datadir}/pixmaps/ install -D -m644 -p contrib/debian/dogecoin-qt.desktop %{buildroot}%{_datadir}/applications/dogecoin-qt.desktop desktop-file-validate %{buildroot}%{_datadir}/applications/dogecoin-qt.desktop install -D -m644 -p contrib/debian/dogecoin-qt.protocol %{buildroot}%{_datadir}/kde4/services/dogecoin-qt.protocol # Install dogecoind #install -D -m755 -p src/dogecoind %{buildroot}%{_sbindir}/dogecoind install -D -m755 -p %{SOURCE3} %{buildroot}%{_initrddir}/dogecoin install -d -m750 -p %{buildroot}%{_localstatedir}/lib/dogecoin install -d -m750 -p %{buildroot}%{_sysconfdir}/dogecoin install -D -m644 -p contrib/debian/examples/bitcoin.conf %{buildroot}%{_sysconfdir}/dogecoin/dogecoin.conf install -D -m644 -p contrib/debian/manpages/bitcoind.1 %{buildroot}%{_mandir}/man1/dogecoind.1 install -D -m644 -p contrib/debian/manpages/bitcoin.conf.5 %{buildroot}%{_mandir}/man5/dogecoin.conf.5 gzip %{buildroot}%{_mandir}/man1/dogecoind.1 gzip %{buildroot}%{_mandir}/man5/dogecoin.conf.5 # Remove test files rm -f %{buildroot}%{_bindir}/test_* # Install SELinux policy for selinuxvariant in %{selinux_variants} do install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant} install -p -m 644 SELinux/dogecoin.pp.${selinuxvariant} \ %{buildroot}%{_datadir}/selinux/${selinuxvariant}/dogecoin.pp done %clean rm -rf %{buildroot} %pre server getent group dogecoin >/dev/null || groupadd -r dogecoin getent passwd dogecoin >/dev/null || useradd -r -g dogecoin -d /var/lib/dogecoin -s /sbin/nologin \ -c "Dogecoin wallet server" dogecoin exit 0 %post server /sbin/chkconfig --add dogecoin for selinuxvariant in %{selinux_variants} do /usr/sbin/semodule -s ${selinuxvariant} -i \ %{_datadir}/selinux/${selinuxvariant}/dogecoin.pp \ &> /dev/null || : done # FIXME This is less than ideal, but until dwalsh gives me a better way... /usr/sbin/semanage port -a -t dogecoin_port_t -p tcp 22555 # RPC /usr/sbin/semanage port -a -t dogecoin_port_t -p tcp 22556 # P2P /usr/sbin/semanage port -a -t dogecoin_port_t -p tcp 44555 # Test RPC /usr/sbin/semanage port -a -t dogecoin_port_t -p tcp 44556 # Test P2P /sbin/fixfiles -R dogecoin-server restore &> /dev/null || : /sbin/restorecon -R %{_localstatedir}/lib/dogecoin || : %preun server if [ $1 -eq 0 ] ; then /sbin/service dogecoin stop >/dev/null 2>&1 /sbin/chkconfig --del dogecoin fi %postun server if [ "$1" -ge "1" ] ; then /sbin/service dogecoin condrestart >/dev/null 2>&1 || : else /sbin/fixfiles -R dogecoin-server restore &> /dev/null || : fi if [ $1 -eq 0 ] ; then # FIXME This is less than ideal, but until dwalsh gives me a better way... /usr/sbin/semanage port -d -p tcp 22555 # RPC /usr/sbin/semanage port -d -p tcp 22556 # P2P /usr/sbin/semanage port -d -p tcp 44555 # Test RPC /usr/sbin/semanage port -d -p tcp 44556 # Test P2P for selinuxvariant in %{selinux_variants} do /usr/sbin/semodule -s ${selinuxvariant} -r dogecoin \ &> /dev/null || : done /sbin/fixfiles -R dogecoin-server restore &> /dev/null || : [ -d %{_localstatedir}/lib/dogecoin ] && \ /sbin/restorecon -R %{_localstatedir}/lib/dogecoin \ &> /dev/null || : fi %files %defattr(-,root,root,-) %doc COPYING README.md dogecoin.conf.example %{_bindir}/dogecoin-qt %{_datadir}/applications/dogecoin-qt.desktop %{_datadir}/kde4/services/dogecoin-qt.protocol %{_datadir}/pixmaps/* %files cli %defattr(-,root,root,-) %doc COPYING README.md %{_bindir}/dogecoin-cli %files server %defattr(-,root,root,-) %doc COPYING README.md %dir %attr(750,dogecoin,dogecoin) %{_localstatedir}/lib/dogecoin %dir %attr(750,dogecoin,dogecoin) %{_sysconfdir}/dogecoin %doc SELinux/* %{_sbindir}/dogecoind %{_initrddir}/dogecoin %config(noreplace) %{_sysconfdir}/dogecoin/dogecoin.conf %{_mandir}/man1/dogecoind.1.gz %{_mandir}/man5/dogecoin.conf.5.gz %{_datadir}/selinux/*/dogecoin.pp %changelog * Wed May 14 2014 Scott R. Shinn - 1.7-3 - Update to 1.7 - Fixes for overlap with bitcoin package * Fri Mar 14 2014 Scott R. Shinn - 1.6-2 - Update to 1.6 - Tmp disable overlaping pixmaps files from bitcoin package * Thu Feb 20 2014 Graham Forest 1.5.2-1 - Version bump * Sat Feb 8 2014 Graham Forest 1.5.1-1 - Version bump * Sun Jan 26 2014 Graham Forest 1.4.1-1 - Port specfile to dogecoin - Fix date error in changelog preventing rpmlint - Remove references to toplevel src dir - Backport in needed contrib/ files from dogecoin 1.5 alpha - Port patches to dogecoin paths - Update ports for RPC/P2P (with testnet) and IRC * Wed Jan 8 2014 Michael Hampton 0.8.6-3 - Fix typo causing a nonexistent dependency to be pulled, fixes #9 * Thu Dec 12 2013 Michael Hampton 0.8.6-2 - Boost no longer requires -mt on Fedora 20+ so omit this option and patch * Wed Oct 16 2013 Michael Hampton 0.8.5-2 - Remove bitcoind and bitcoin-qt launcher scripts no longer used upstream - Ship upstream example config file * Sat Oct 05 2013 Michael Hampton 0.8.5-1 - Update for Bitcoin 0.8.5. * Wed Sep 04 2013 Michael Hampton 0.8.4-1 - Update for Bitcoin 0.8.4. - Strip OS X resource forks from upstream tarball. - Use default SELinux context for /etc/bitcoin directory itself; fixes SELinux denial against updatedb. * Fri Jul 05 2013 Michael Hampton 0.8.3-1 - Update for Bitcoin 0.8.3. * Sun Jun 02 2013 Michael Hampton 0.8.2-2 - Fixed bitcoin-server dependency for new openssl packages * Sun Jun 02 2013 Michael Hampton 0.8.2-1 - Update for Bitcoin 0.8.2. * Fri Mar 29 2013 Michael Hampton 0.8.1-3 - Added missing openssl and boost Requires for bitcoin-server * Sun Mar 24 2013 Michael Hampton 0.8.1-2 - Added missing SELinux dependencies - Updated for RHEL: Now build against a private copy of Boost * Thu Mar 21 2013 Michael Hampton 0.8.1-1 - Update for Bitcoin 0.8.1. - Removed Patch2 (qt 4.6 compatibility) as it has been accepted upstream * Tue Jan 29 2013 Michael Hampton 0.7.2-3 - Mass rebuild for corrected package signing key * Mon Dec 17 2012 Michael Hampton 0.7.2-1 - Update for Bitcoin 0.7.2. - Update for separate OpenSSL package openssl-compat-bitcoin. * Wed Aug 22 2012 Michael Hampton 0.6.3-1 - Initial package.