Update package helpers

This commit is contained in:
Camille Monière 2022-02-14 12:06:14 +01:00
parent 8d77b77113
commit 084b5bbd8b
Signed by: moniere
GPG key ID: 188DD5B072181C0F
8 changed files with 126 additions and 28 deletions

4
.gitignore vendored
View file

@ -39,7 +39,9 @@
test
# packages
packages/tarball/*.tar.gz
packages/tarball/*
!packages/tarball/makefile
!packages/tarball/make_tarball.sh
packages/debian/*
!packages/debian/control

17
packages/ap_fixed.h Normal file
View file

@ -0,0 +1,17 @@
/*
* Copyright 2022 DrasLorus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <ap_types/ap_fixed.h>

17
packages/ap_int.h Normal file
View file

@ -0,0 +1,17 @@
/*
* Copyright 2022 DrasLorus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <ap_types/ap_int.h>

View file

@ -1,5 +1,5 @@
Package: hls-ap-types
Version: 0.0.1
Version: 0.0.1.rc2
Maintainer: Camille 'DrasLorus' Monière <draslorus@draslorus.fr>
Depends:
Architecture: all

View file

@ -1,8 +1,30 @@
#! /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
#
# Copyright 2022 DrasLorus.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
version="$(grep "Version" control | cut -d ' ' -f 2)"
deb_dir="hls-ap-types_$version-1_all"
include_dir="$deb_dir/usr/include"
rm -rfv "$deb_dir"
install -dm755 "$include_dir"/ap_types/etc
install -m644 -t "$include_dir"/ap_types ../../include/*.h
install -Dm644 -t "$include_dir"/ap_types/etc ../../include/etc/ap_private.h
install -m644 -t "$include_dir"/ ../ap_*.h
mkdir -p hls-ap-types_"$version"-1_all/DEBIAN
cp control hls-ap-types_"$version"-1_all/DEBIAN

View file

@ -1,28 +1,21 @@
# 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>
# Maintainer: DrasLorus <draslorus@draslorus.fr>
pkgname=hls-ap-types
pkgver=0.0.1.rc1
pkgver=0.0.1.rc2
pkgrel=1
pkgdesc="AP types for everyone"
arch=('any')
url="https://github.com/DrasLorus/HLS_arbitrary_Precision_Types"
license=('apache2.0')
license=('Apache')
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')
source=("https://github.com/DrasLorus/HLS_arbitrary_Precision_Types/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('90837e08801ab75f9084c6070a14ee60cae0d78b6a4bec47f1b49a4b9772b90d')
package() {
cd "$srcdir"
_files="$(find include -name .h)"
make PREFIX="${pkgdir}" install
install -dvm644 "${pkgdir}/usr/share/licenses/hls-ap-types/LICENSE" LICENSE.txt
install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -m644 -t "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" "${pkgname}-${pkgver}/LICENSE.TXT"
}

View file

@ -1,2 +1,30 @@
#! /bin/sh
tar -cvzf hls-ap-types-0.0.1-RC1.tar.gz ../../include makefile ../../LICENSE.TXT
#
# Copyright 2022 DrasLorus.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
version="0.0.1.rc2"
tar_dir="hls-ap-types-$version"
rm -rfv "$tar_dir"
install -dm755 "$tar_dir"/ap_types/etc
install -m644 -t "$tar_dir"/ ../../LICENSE.TXT
install -m644 -t "$tar_dir"/ap_types ../../include/*.h
install -Dm644 -t "$tar_dir"/ap_types/etc ../../include/etc/ap_private.h
install -m644 -t "$tar_dir"/ ../ap_*.h
tar -cvzf "$tar_dir".tar.gz "$tar_dir" makefile

View file

@ -1,15 +1,34 @@
files:=$(wildcard include/*.h)
files+=include/etc/ap_private.h
#
# Copyright 2022 DrasLorus.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
tar_dir=hls-ap-types-0.0.1.rc2
ap_types_files:=$(wildcard $(tar_dir)/ap_types/*.h)
top_files:=$(wildcard $(tar_dir)/*.h)
priv_files:=$(wildcard $(tar_dir)/ap_types/etc/*.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
install -dCm755 $(PREFIX)/usr/include/ap_types/etc
install -Cm644 -t $(PREFIX)/usr/include $(top_files)
install -Cm644 -t $(PREFIX)/usr/include/ap_types/ $(ap_types_files)
install -Cm644 -t $(PREFIX)/usr/include/ap_types/etc $(priv_files)
uninstall:
unlink $(PREFIX)/usr/include/ap_fixed.h
unlink $(PREFIX)/usr/include/ap_int.h
rm $(PREFIX)/usr/include/ap_fixed.h
rm $(PREFIX)/usr/include/ap_int.h
@rm -rv $(PREFIX)/usr/include/ap_types