blob: 5f59d44a7920a4fc752b231c3eba0f1c61c5ae57 (
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
|
# Maintainer: Carl Smedstad <carl.smedstad at protonmail dot com>
pkgname=licensee
_name=licensee
pkgver=9.16.0
pkgrel=2
pkgdesc='Detect under what license a project is distributed'
arch=(any)
url='https://github.com/licensee/licensee'
license=(MIT)
depends=(
ruby-dotenv
ruby-octokit
ruby-reverse_markdown
ruby-rugged
ruby-thor
)
makedepends=(rubygems)
checkdepends=(
git
ruby-mustache
ruby-rspec
ruby-simplecov
ruby-webmock
)
options=(!emptydirs)
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('7f1895d93f16886c427027deda254139d7fde23f6e7a8c7ea1c3def00804ff8e')
_archive="$pkgname-$pkgver"
prepare() {
cd "$_archive"
# update gemspec/Gemfile to allow newer version of the dependencies
sed --in-place --regexp-extended 's|~>|>=|g' "$_name.gemspec"
# we don't build from a git checkout
sed --in-place --regexp-extended 's|.*git ls-files.*| ]|' "$_name.gemspec"
}
build() {
cd "$_archive"
local _gemdir
_gemdir="$(gem env gemdir)"
gem build "$_name.gemspec"
gem install \
--local \
--verbose \
--ignore-dependencies \
--no-user-install \
--install-dir "tmp_install/$_gemdir" \
--bindir "tmp_install/usr/bin" \
"$_name-$pkgver.gem"
# remove unrepreducible files
rm --force --recursive --verbose \
"tmp_install/$_gemdir/cache/" \
"tmp_install/$_gemdir/doc/$_name-$pkgver/ri/ext/"
find "tmp_install/$_gemdir/gems/" \
-type f \
\( \
-iname "*.o" -o \
-iname "*.c" -o \
-iname "*.so" -o \
-iname "*.time" -o \
-iname "gem.build_complete" -o \
-iname "Makefile" \
\) \
-delete
find "tmp_install/$_gemdir/extensions/" \
-type f \
\( \
-iname "mkmf.log" -o \
-iname "gem_make.out" \
\) \
-delete
}
check() {
cd "$_archive"
export GIT_CONFIG_GLOBAL="$PWD/git.config"
git config --global init.defaultBranch master
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
# Not running the following tests due to failures:
# spec/bin_spec.rb
# spec/licensee/commands/detect_spec.rb
# spec/licensee/commands/license_path_spec.rb
# spec/licensee/commands/version_spec.rb
local _gemdir
_gemdir="$(gem env gemdir)"
GEM_HOME="tmp_install/$_gemdir" rspec \
spec/fixture_spec.rb \
spec/integration_spec.rb \
spec/licensee/content_helper_spec.rb \
spec/licensee/hash_helper_spec.rb \
spec/licensee/license_field_spec.rb \
spec/licensee/license_meta_spec.rb \
spec/licensee/license_rules_spec.rb \
spec/licensee/license_spec.rb \
spec/licensee/matchers/cabal_matcher_spec.rb \
spec/licensee/matchers/cargo_matcher_spec.rb \
spec/licensee/matchers/copyright_matcher_spec.rb \
spec/licensee/matchers/cran_matcher_spec.rb \
spec/licensee/matchers/dice_matcher_spec.rb \
spec/licensee/matchers/dist_zilla_matcher_spec.rb \
spec/licensee/matchers/exact_matcher_spec.rb \
spec/licensee/matchers/gemspec_matcher_spec.rb \
spec/licensee/matchers/matcher_spec.rb \
spec/licensee/matchers/npm_bower_matcher_spec.rb \
spec/licensee/matchers/nu_get_matcher_spec.rb \
spec/licensee/matchers/package_matcher_spec.rb \
spec/licensee/matchers/reference_matcher_spec.rb \
spec/licensee/matchers/spdx_matcher_spec.rb \
spec/licensee/project_files/license_file_spec.rb \
spec/licensee/project_files/package_info_spec.rb \
spec/licensee/project_files/project_file_spec.rb \
spec/licensee/project_files/readme_file_spec.rb \
spec/licensee/project_spec.rb \
spec/licensee/projects/git_project_spec.rb \
spec/licensee/projects/github_project_spec.rb \
spec/licensee/rule_spec.rb \
spec/licensee_spec.rb \
spec/spec_helper.rb \
spec/vendored_license_spec.rb
}
package() {
cd "$_archive"
cp --archive --verbose tmp_install/* "${pkgdir}"
install --verbose -D --mode=0644 LICENSE.md --target-directory "$pkgdir/usr/share/licenses/$pkgname"
install --verbose -D --mode=0644 ./*.md --target-directory "$pkgdir/usr/share/doc/$pkgname"
}
|