example.sh 1.25 KB
Newer Older
1
#!/bin/sh
Vitaly Lipatov's avatar
Vitaly Lipatov committed
2 3 4 5
# Place your shell code here
# It will be run with two args: buildroot spec
# Name this script as package name

6
# You can use follow commands here: epm, subst, realpath
7

8 9 10 11
# subst - the same like sed -i
# realpath - print real path (resolved path) of a file

# root dir of the files
12
BUILDROOT="$1"
13
# rpm spec file
14
SPEC="$2"
15 16 17 18
# package name (usually the same as filename)
# PACKAGENAME="$3"
# full path to a package we repacking
ORIGINPACKAGE="$4"
19

20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
# a command to run the application from cli (get from the script name by default)
#PRODUCT=<cmd>
# path to the application (/opt/$PRODUCT by default)
#PRODUCTDIR=/opt/$PRODUCT

. $(dirname $0)/common.sh


# spec additions
# subst '1iAutoReq:no' $SPEC

# fix script example
# subst "s|/usr/bin/sh|/bin/sh|" $BUILDROOT$PRODUCTDIR/cmd.bash

# copy and add file to the package
# install_file $PRODUCTDIR/aimp.desktop /usr/share/applications/$PRODUCT.desktop

# download and add file to the package
# install_file https://dashboard.snapcraft.io/site_media/appmedia/2020/04/icq_copy.png /usr/share/pixmaps/$PRODUCT.png

# remove file from the package
# remove_file /usr/share/anydesk/files/init/anydesk

# drop according lines from autogenerated requires
# filter_from_requires libpangox-1.0.so.0 libgdkglext-x11-1.0.so.0 libsomename