Skip to content

Commit ef746b5

Browse files
authored
Introduced Generation of RPM
Fix #41
1 parent dd36b64 commit ef746b5

4 files changed

Lines changed: 83 additions & 0 deletions

File tree

packaging/rpm/SPECS/CXXGraph.spec

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
Name: CXXGraph
2+
Version: 0.1
3+
Release: 4%{?dist}
4+
Summary: Header-Only C++ Library for Graph Representation and Algorithms
5+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
6+
Prefix:/usr
7+
8+
License: AGPLv3.0
9+
URL: https://github.com/ZigRazor/CXXGraph
10+
Source0: https://github.com/ZigRazor/CXXGraph/archive/refs/tags/v0.1.4.tar.gz
11+
12+
#Requires: bash
13+
14+
BuildArch: noarch
15+
16+
%define _topdir %(echo $PWD)/
17+
%description
18+
Header-Only C++ Library for Graph Representation, Manipulation, Partitioning and Algorithms
19+
20+
%precd rm
21+
echo " |------------------------------------------------| "
22+
echo " |------------ CXXGraph Library --------------| "
23+
echo " |------------------------------------------------| "
24+
25+
26+
%prep
27+
cd %{_topdir}
28+
#%{_topdir}/../targzip.sh
29+
../targzip.sh
30+
31+
%build
32+
33+
%install
34+
rm -rf %{buildroot}
35+
mkdir -p %{buildroot}%{prefix}/include
36+
cp -rp %{_topdir}/../../include/* %{buildroot}%{prefix}/include/
37+
38+
echo " |------------------------------------------------| "
39+
echo " |-------- Installation Completed ------------| "
40+
echo " |------------------------------------------------| "
41+
42+
%preun
43+
echo " |------------------------------------------------| "
44+
echo " |------------ CXXGraph Library --------------| "
45+
echo " |------------------------------------------------| "
46+
47+
%postun
48+
rm -rf /usr/include/Graph.hpp /usr/include/CXXGraphConfig.h
49+
echo " |------------------------------------------------| "
50+
echo " |------- Uninstallation Completed -----------| "
51+
echo " |------------------------------------------------| "
52+
53+
%clean
54+
rm -rf %{buildroot}
55+
56+
%files
57+
%defattr(-,root,root)
58+
%{prefix}/include
59+
60+
%changelog
61+
* Mon Jul 26 2021 ZigRazor <zigrazor@gmail.com> - 0.1-4
62+
- First RPM package

packaging/rpm/clean_rpm.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
rm -rf BUILD RPMS SOURCES SRPMS #clean directories

packaging/rpm/make_rpm.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
#Clean
4+
./clean_rpm.sh
5+
6+
#Prepare Directories
7+
8+
mkdir BUILD
9+
mkdir RPMS
10+
mkdir SOURCES
11+
mkdir SRPMS
12+
13+
#Build RPMs
14+
15+
rpmbuild -ba SPECS/CXXGraph.spec

packaging/targzip.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
tar -cvzf SOURCES/v0.1.4.tar.gz ../../include/*

0 commit comments

Comments
 (0)