summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4da39ae18bf733ed9630b5de836abe2da468a3a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# Maintainer:  dreieck (https://aur.archlinux.org/account/dreieck)
# Contributor: Alex S. <shantanna_at_hotmail_dot_com>
# Contributor: Philipp Wolfer <ph.wolfer (at) gmail.com>

_gitname=rogerrouter
_pkgname=roger-router
pkgname="${_pkgname}-git"
pkgver=2.4.90+1.r1426.20230428.f33129a
pkgrel=3
pkgdesc="A utility to control and monitor AVM Fritz!Box Routers. E.g. Journal, fax software and call monitor."
arch=(
  'aarch64'
  'x86_64'
  'i686'
  'pentium4'
  'armv5h'
  'armv6h'
  'armv7h'
)
url="https://tabos.org/projects/rogerrouter/"
license=('GPL-2.0-only')
depends=(
  "gcc-libs"
  "ghostscript"
  "glib2"
  "glibc"
  "gtk3"
  "libcairo.so"
  "librm.so"
  "libgdk_pixbuf-2.0.so"
  "libhandy-1.so"
  "libpango-1.0.so"
  "libpangocairo-1.0.so"
  "libsoup-2.4.so"
  "libtiff.so"
)
makedepends=(
  "appstream-glib"  # For 'appstream-util'
  "cairo"
  "cups"            # To have 'lp' group to create spool directory owned by that group in the '$install' script.
  "desktop-file-utils"
  "gdk-pixbuf2"
  "gettext"
  "git"
  "glib2-devel"
  "gobject-introspection"
  "intltool"
  "librm"
  "libhandy"
  "libsoup>=2"
  "libsoup<3"
  "libtiff"
  "meson"
  "ninja"
  "pango"
  "pkgconf"
)
optdepends=(
  'cups:               FAX printer'
  'dconf:              for glib schemas'
  'hicolor-icon-theme: hicolor theme hierarchy'
)
conflicts=(
  "${_gitname}"
  "${_pkgname}"
  #"roger"
)
provides=(
  "${_gitname}=${pkgver}"
  "${_pkgname}=${pkgver}"
  #"roger=${pkgver}"
)
replaces=(
  "${_gitname}"
)
install="roger-router.install"
source=(
  "${_gitname}::git+https://gitlab.com/tabos/rogerrouter.git"
  "disable-evolution-plugin.patch"
  "address-book.svg"
  "${install}"
)
sha256sums=(
  'SKIP'  # Upstream source
  '723b426e766612f7c3888d98bfe306b9643d97c3f5097398c7dc3feed2ec8b9a'  # disable-evolution-plugin.patch
  '575b01dc0e68fd2f0b3d3c10afdec6fd4d61b570ec3d093e722c9fec35e6f82d'  # address-book.svg
  '7a32640a30cd73eb4e50af04b30fdcce93bd0b263577ad941037253608e86cfc'  # $install
)
options+=('emptydirs')
#options+=('!lto' 'debug')

_CFLAGSADDITIONS="-w -Wno-error=incompatible-pointer-types"

prepare() {
  CFLAGS+=" ${_CFLAGSADDITIONS}"
  CXXFLAGS+=" ${_CFLAGSADDITIONS}"
  export CFLAGS
  export CXXFLAGS

  cd "${srcdir}/${_gitname}"

  for _patch in "${srcdir}"/disable-evolution-plugin.patch; do
    printf '%s\n' "   > Applying patch '$(basename "${_patch}")' ..."
    patch -N -p1 --follow-symlinks -i "${_patch}"
  done

  git log > git.log

  cd "${srcdir}"
  arch-meson "${_gitname}" build --reconfigure
}

pkgver() {
  cd "${srcdir}/${_gitname}"

  _ver="$(git describe --tags | sed -E -e 's|^[vV]||' -e 's|\-g[0-9a-f]*$||' | tr '-' '+')"
  _rev="$(git rev-list --count HEAD)"
  _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
  _hash="$(git rev-parse --short HEAD)"

  if [ -z "${_ver}" ]; then
    error "Version could not be determined."
    return 1
  else
    printf '%s' "${_ver}.r${_rev}.${_date}.${_hash}"
  fi
}

build() {
  CFLAGS+=" ${_CFLAGSADDITIONS}"
  CXXFLAGS+=" ${_CFLAGSADDITIONS}"
  export CFLAGS
  export CXXFLAGS

  cd "${srcdir}"
  ninja -v -j1 -C "build"
}

check() {
  CFLAGS+=" ${_CFLAGSADDITIONS}"
  CXXFLAGS+=" ${_CFLAGSADDITIONS}"
  export CFLAGS
  export CXXFLAGS

  cd "${srcdir}"
  ninja -v -C "build" test
}

package() {
  CFLAGS+=" ${_CFLAGSADDITIONS}"
  CXXFLAGS+=" ${_CFLAGSADDITIONS}"
  export CFLAGS
  export CXXFLAGS

  cd "${srcdir}"
  DESTDIR="${pkgdir}" ninja -v -C "build" install
  install -Dvm644 -t "${pkgdir}/usr/share/icons/hicolor/symbolic" "address-book.svg"

  cd "${srcdir}/${_gitname}"

  install -Dvm644 -t "${pkgdir}/usr/share/doc/${_pkgname}"      git.log README.md
  install -Dvm644 -t "${pkgdir}/usr/share/licenses/${pkgname}"  COPYING
}