Skip to content

Commit

Permalink
Introduced Packaging for Debian/Ubuntu
Browse files Browse the repository at this point in the history
Added script to generate all packages

fix #42
  • Loading branch information
ZigRazor authored Jul 27, 2021
1 parent ef746b5 commit ac6b443
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 4 deletions.
8 changes: 8 additions & 0 deletions packaging/deb/CXXGraph/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Package: CXXGraph
Version: 0.1.4
Section: custom
Priority: optional
Architecture: all
Essential: no
Maintainer: zigrazor@gmail.com
Description: Header-Only C++ Library for Graph Representation and Algorithms
4 changes: 4 additions & 0 deletions packaging/deb/clean_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

rm -rf CXXGraph/usr
rm -rf *.deb
15 changes: 15 additions & 0 deletions packaging/deb/make_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

#Clean
./clean_deb.sh

#Prepare
mkdir -p CXXGraph/usr/include/
chmod -R 0755 CXXGraph/DEBIAN
cp -r ../../include/* CXXGraph/usr/include/

#Packaging
dpkg-deb --build CXXGraph

#Rename
mv CXXGraph.deb CXXGraph_$VERSION-$RELEASE.deb
30 changes: 30 additions & 0 deletions packaging/make_packaging.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

#variables
MAJOR=$(cat ../include/CXXGraphConfig.h | grep CXXGraph_VERSION_MAJOR | awk '{ print $3 }')
MINOR=$(cat ../include/CXXGraphConfig.h | grep CXXGraph_VERSION_MINOR | awk '{ print $3 }')
PATCH=$(cat ../include/CXXGraphConfig.h | grep CXXGraph_VERSION_PATCH | awk '{ print $3 }')

echo "Packaging version $MAJOR.$MINOR.$PATCH"

export VERSION=${MAJOR}.${MINOR}
export RELEASE=${PATCH}

#tarballs
echo "Create Tarballs..."
./tarballs.sh
echo "Tarballs Created"

#rpm
echo "Create RPM..."
cd rpm
./make_rpm.sh
cd ..
echo "RPM Created"

echo "Create DEB..."
#deb
cd deb
./make_deb.sh
cd ..
echo "DEB Created"
4 changes: 2 additions & 2 deletions packaging/rpm/SPECS/CXXGraph.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: CXXGraph
Version: 0.1
Release: 4%{?dist}
Version: %{getenv:VERSION}
Release: %{getenv:RELEASE}%{?dist}
Summary: Header-Only C++ Library for Graph Representation and Algorithms
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Prefix:/usr
Expand Down
2 changes: 1 addition & 1 deletion packaging/tarballs.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

tar --transform='flags=r;s|include/|/usr/include/|' -cvjSf CXXGraph.tar.bz2 ../include/*
tar --transform='flags=r;s|include/|/usr/include/|' -cvjSf CXXGraph-$VERSION-$RELEASE.tar.bz2 ../include/*
2 changes: 1 addition & 1 deletion packaging/targzip.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

tar -cvzf SOURCES/v0.1.4.tar.gz ../../include/*
tar -cvzf SOURCES/v$VERSION.$RELEASE.tar.gz ../../include/*

0 comments on commit ac6b443

Please sign in to comment.