Skip to content

Commit

Permalink
Introduced Generation of RPM
Browse files Browse the repository at this point in the history
Fix #41
  • Loading branch information
ZigRazor committed Jul 27, 2021
1 parent dd36b64 commit ef746b5
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
62 changes: 62 additions & 0 deletions packaging/rpm/SPECS/CXXGraph.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Name: CXXGraph
Version: 0.1
Release: 4%{?dist}
Summary: Header-Only C++ Library for Graph Representation and Algorithms
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Prefix:/usr

License: AGPLv3.0
URL: https://github.com/ZigRazor/CXXGraph
Source0: https://github.com/ZigRazor/CXXGraph/archive/refs/tags/v0.1.4.tar.gz

#Requires: bash

BuildArch: noarch

%define _topdir %(echo $PWD)/
%description
Header-Only C++ Library for Graph Representation, Manipulation, Partitioning and Algorithms

%precd rm
echo " |------------------------------------------------| "
echo " |------------ CXXGraph Library --------------| "
echo " |------------------------------------------------| "


%prep
cd %{_topdir}
#%{_topdir}/../targzip.sh
../targzip.sh

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{prefix}/include
cp -rp %{_topdir}/../../include/* %{buildroot}%{prefix}/include/

echo " |------------------------------------------------| "
echo " |-------- Installation Completed ------------| "
echo " |------------------------------------------------| "

%preun
echo " |------------------------------------------------| "
echo " |------------ CXXGraph Library --------------| "
echo " |------------------------------------------------| "

%postun
rm -rf /usr/include/Graph.hpp /usr/include/CXXGraphConfig.h
echo " |------------------------------------------------| "
echo " |------- Uninstallation Completed -----------| "
echo " |------------------------------------------------| "

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%{prefix}/include

%changelog
* Mon Jul 26 2021 ZigRazor <zigrazor@gmail.com> - 0.1-4
- First RPM package
3 changes: 3 additions & 0 deletions packaging/rpm/clean_rpm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

rm -rf BUILD RPMS SOURCES SRPMS #clean directories
15 changes: 15 additions & 0 deletions packaging/rpm/make_rpm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

#Clean
./clean_rpm.sh

#Prepare Directories

mkdir BUILD
mkdir RPMS
mkdir SOURCES
mkdir SRPMS

#Build RPMs

rpmbuild -ba SPECS/CXXGraph.spec
3 changes: 3 additions & 0 deletions packaging/targzip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

tar -cvzf SOURCES/v0.1.4.tar.gz ../../include/*

0 comments on commit ef746b5

Please sign in to comment.