Add packaging method

This commit is contained in:
Camille Monière 2022-02-08 18:50:43 +01:00
parent 75ccdc73c8
commit 8d77b77113
Signed by: moniere
GPG key ID: 188DD5B072181C0F
7 changed files with 77 additions and 2 deletions

11
.gitignore vendored
View file

@ -37,3 +37,14 @@
# test folder # test folder
test test
# packages
packages/tarball/*.tar.gz
packages/debian/*
!packages/debian/control
!packages/debian/make_deb.sh
*.deb
packages/hls-ap-types-arch/*
!packages/hls-ap-types-arch/PKGBUILD

View file

@ -18,7 +18,7 @@ Include the `ap_int.h` or `ap_fixed.h` in C++ code,
and set compiler option to add the path of `include` directory in this repo and set compiler option to add the path of `include` directory in this repo
into header search directory list. into header search directory list.
``` ``` shell
$ cd examples/ap_int $ cd examples/ap_int
$ g++ -I ../../include/ test.cpp $ g++ -I ../../include/ test.cpp
$ ./a.out $ ./a.out
@ -39,7 +39,9 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 ``` text
http://www.apache.org/licenses/LICENSE-2.0
```
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,

7
packages/debian/control Normal file
View file

@ -0,0 +1,7 @@
Package: hls-ap-types
Version: 0.0.1
Maintainer: Camille 'DrasLorus' Monière <draslorus@draslorus.fr>
Depends:
Architecture: all
Homepage: https://github.com/DrasLorus/HLS_arbitrary_Precision_Types
Description: AP Types for everyone

View file

@ -0,0 +1,10 @@
#! /bin/sh
version="$(grep "Version" control | cut -d ' ' -f 2)"
mkdir -p hls-ap-types_"$version"-1_all/usr/include/ap_types
cp -r ../../include hls-ap-types_"$version"-1_all/usr/include/ap_types
mkdir -p hls-ap-types_"$version"-1_all/DEBIAN
cp control hls-ap-types_"$version"-1_all/DEBIAN
dpkg --build hls-ap-types_"$version"-1_all

View file

@ -0,0 +1,28 @@
# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.
# Maintainer: Your Name <youremail@domain.com>
pkgname=hls-ap-types
pkgver=0.0.1.rc1
pkgrel=1
pkgdesc="AP types for everyone"
arch=('any')
url="https://github.com/DrasLorus/HLS_arbitrary_Precision_Types"
license=('apache2.0')
source=("$pkgname-$pkgver::https://github.com/DrasLorus/HLS_arbitrary_Precision_Types/releases/download/v0.0.1-RC1/hls-ap-types-0.0.1-RC1.tar.gz")
sha256sums=('f3efea6d742bac7cb99d9b4b7ff718ce82a5f9c6d9f7a4334aca9750ad7cd9fd')
package() {
cd "$srcdir"
_files="$(find include -name .h)"
make PREFIX="${pkgdir}" install
install -dvm644 "${pkgdir}/usr/share/licenses/hls-ap-types/LICENSE" LICENSE.txt
}

View file

@ -0,0 +1,2 @@
#! /bin/sh
tar -cvzf hls-ap-types-0.0.1-RC1.tar.gz ../../include makefile ../../LICENSE.TXT

15
packages/tarball/makefile Normal file
View file

@ -0,0 +1,15 @@
files:=$(wildcard include/*.h)
files+=include/etc/ap_private.h
all: install
install:
@install -dvm755 $(PREFIX)/usr/include/ap_types
@install -vm644 -t $(PREFIX)/usr/include/ap_types/ $(files)
@ln -vs ap_types/ap_fixed.h $(PREFIX)/usr/include/ap_fixed.h
@ln -vs ap_types/ap_int.h $(PREFIX)/usr/include/ap_int.h
uninstall:
unlink $(PREFIX)/usr/include/ap_fixed.h
unlink $(PREFIX)/usr/include/ap_int.h
@rm -rv $(PREFIX)/usr/include/ap_types