Compare commits

...

28 Commits

Author SHA1 Message Date
clrbuilder e80c6eb4bd Update packages file for version 22420
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-15 17:22:37 +00:00
clrbuilder 5cf5fd71cb Update packages file for version 22410
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-15 13:02:06 +00:00
clrbuilder 4b01a5a9cd Update packages file for version 22390
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-14 19:02:44 +00:00
Patrick McCarty 4910ef0882 koji: only pull --rebase if remote is initialized
After running 'make autospecnew', the freshly created repo only exists locally,
so the repo remote is not yet initialized. The 'git pull --rebase' (via 'make
koji') will then fail due to the uninitialized remote. Improve this case by
only rebasing when the remote is initialized.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-05-14 11:49:26 -07:00
clrbuilder 1518adace0 Update packages file for version 22380
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-14 02:27:47 +00:00
clrbuilder ef0e792c3d Update packages file for version 22370
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-12 02:19:56 +00:00
Patrick McCarty 1bb7b0c471 autospecnew: try to clone repo first
If the user tries to create a new package with 'make autospecnew', a
package repo will be created from scratch, even if a repo exists with
the same name at PKG_BASE_URL.

This problem stems from 'make autospecnew' assuming that all tracked
package repos are cloned already, but is a bad assumption, given the
recent change of behavior for user-setup.sh (not cloning package repos
by default).

Resolve it by first trying to clone the repo with "make clone_PKGNAME";
clone_PKGNAME targets are automatically defined for all packages listed
in the projects/common/packages file. As long as users have an
up-to-date packages file (i.e. are running 'make pull' regularly), then
this solution works well. The case not covered is when packages are
added, then later removed; package repos will already exist remotely in
this case. However, this is a relatively rare case, so I opted to only
handle the common case where a package is added and never removed from
the distro at a later point.

(Side note: I originally wanted to 'git ls-remote REPO' to check remote
repo existence, but this does not work well with Github, as Github
prompts for username/password for remotes that appear to not exist,
since they might be private repos. Prompting a Github username/password
in this case is not very user-friendly. Using the Github API looks
viable, but I would rather not special case the handling of Github repos
in the common tooling.)

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-05-11 11:21:41 -07:00
Leandro Dorileo 51dc7a7c24 autospec: use MOCK_OPTS
Also make autospec use MOCK_OPTS to pass down arbitrary mock options.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-05-10 15:48:26 -07:00
George T Kramer c8848dbdb2 Allow additional curl options for fetching sources
The DOWNLOAD_MIRROR server, the SOURCES_URL server, and upstream
source tarballs may be hosted in many different environments.
Allow users to supply additional curl options via a config to use
whenever connecting to the DOWNLOAD_MIRROR and SOURCES_URL servers and
work better with their particular hosting environment.  Because upstream
source tarballs can come from many different locations, do not offer a
global config and instead allow users to define this manually as needed
when the rule is used.

Signed-off-by: George T Kramer <george.t.kramer@intel.com>
2018-05-10 15:22:57 -07:00
Leandro Dorileo 92e045116a mock: add MOCK_OPTS
Eventually developers - when they know what they're doing - want to
manipulate a little bit the mock arguments to i.e skip a few stages
in the mock build cycle while they're hacking a package.

One example is when developers are testing changes to a spec file but
not touching dependencies and they're [re]running the build multiple times
it would be nice to not cleanup before the build and run a rebuild
for example with: --rebuild --no-clean

With this patch one should only do:

make build MOCK_OPTS="--rebuild --no-clean"

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-05-10 14:56:22 -07:00
Patrick McCarty 1f3475a1ef Move "Manual setup" section to end of README
Users are encouraged to run the user-setup script as documented in the
"Automated setup" section. To clarify that the "Manual setup" section is
an alternative to "Automated setup", move those docs to the end of the
README instead.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-05-10 13:28:18 -07:00
Patrick McCarty f836786e2d user-setup: update docs in the README
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-05-10 13:23:34 -07:00
Patrick McCarty 7dc88fd01a user-setup: do not clone package repos by default
Because the package repo cloning process can take a lot of time, do not
clone them by default. Instead, add a new --clone-packages|-a option to
perform this task.

Also, immediately before the script exits, document some possible next
steps when *not* cloning package repos (the new default).

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-05-10 12:01:25 -07:00
Patrick McCarty 250efaef8f user-setup: enable a configurable workspace name
To allow setting up multiple workspaces in the same directory, or if the
name "clearlinux" is not the desired name, add a --directory|-d option
to let the user configure it.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-05-10 11:46:52 -07:00
Patrick McCarty c6532c6759 user-setup: enable parallel repo cloning
Since Clear Linux has many package repos, cloning them all in serial can
take a long time. Add a -j option to the script to let users speed up
the process.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-05-10 11:19:15 -07:00
Patrick McCarty f1c85e3294 user-setup: switch to 2-space indent
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-05-10 10:45:12 -07:00
clrbuilder f5abc3a8d3 Update packages file for version 22340
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-09 19:02:00 +00:00
clrbuilder 74d5bc42f5 Update packages file for version 22330
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-09 13:02:01 +00:00
clrbuilder d6cc120a3c Update packages file for version 22310
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-08 14:07:03 +00:00
clrbuilder 71c1bd013f Update packages file for version 22290
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-07 13:19:54 +00:00
clrbuilder aadbd40a21 Update packages file for version 22250
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-03 19:38:24 +00:00
clrbuilder 60020aebcc Update packages file for version 22230
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-03 13:01:47 +00:00
clrbuilder 3a00f7eda4 Update packages file for version 22220
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-02 19:02:26 +00:00
clrbuilder 0470861400 Update packages file for version 22210
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-02 13:01:58 +00:00
clrbuilder 4fac58a65e Update packages file for version 22190
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-05-01 13:02:34 +00:00
clrbuilder 743041a30c Update packages file for version 22180
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-04-30 17:25:53 +00:00
clrbuilder 59f9bb1f7a Update packages file for version 22150
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-04-28 21:26:16 +00:00
clrbuilder 1e74d17500 Update packages file for version 22120
Signed-off-by: clrbuilder <clrbuilder@intel.com>
2018-04-26 19:20:29 +00:00
6 changed files with 254 additions and 172 deletions
+18 -11
View File
@@ -20,8 +20,7 @@ RPMS ?= $(LATEST_RPMS)
WITH_SUDO = $(shell cmp /usr/bin/mock /usr/sbin/mock &> /dev/null && echo sudo ) WITH_SUDO = $(shell cmp /usr/bin/mock /usr/sbin/mock &> /dev/null && echo sudo )
# MOCK_CONFIG_VAL is set in Makefile.shared # MOCK_CONFIG_VAL is set in Makefile.shared
MOCK ?= $(WITH_SUDO) /usr/bin/mock -r $(MOCK_CONFIG_VAL) MOCK ?= $(WITH_SUDO) /usr/bin/mock -r $(MOCK_CONFIG_VAL) $(MOCK_OPTS)
ifneq ($(wildcard upstream),) ifneq ($(wildcard upstream),)
__allsources := $(notdir $(strip $(shell cat upstream))) __allsources := $(notdir $(strip $(shell cat upstream)))
@@ -89,6 +88,7 @@ prebuild-checks:
#help files and rpms in the results directory of your package. If there #help files and rpms in the results directory of your package. If there
#help are mutlple tar.gz files for a package, make will do make sources, #help are mutlple tar.gz files for a package, make will do make sources,
#help which creates a src.rpm file from the spec file. #help which creates a src.rpm file from the spec file.
#help Use MOCK_OPTS environment varible to pass down arbitrary mock options.
build: prebuild-checks configemail $(SPECFILE) upstream $(SRPMFILE) build: prebuild-checks configemail $(SPECFILE) upstream $(SRPMFILE)
$(MOCK) $(SRPMFILE) --result=results/ --no-cleanup-after --uniqueext=$(PKG_NAME) $(MOCK) $(SRPMFILE) --result=results/ --no-cleanup-after --uniqueext=$(PKG_NAME)
@perl $(TOPLVL)/projects/common/logcheck.pl results/build.log @perl $(TOPLVL)/projects/common/logcheck.pl results/build.log
@@ -150,8 +150,10 @@ pullrebase:
#help autospec: automatically generates a specfile. If there is #help autospec: automatically generates a specfile. If there is
#help already a specfile, it will be overwritten. Several files used by #help already a specfile, it will be overwritten. Several files used by
#help autospec will be created in the process. For more information, see #help autospec will be created in the process.
#help the project at https://github.com/clearlinux/autospec #help Use MOCK_OPTS environment varible to pass down arbitrary mock options
#help to autospec.
#help For more information, see the project at https://github.com/clearlinux/autospec
autospec: pullrebase localreponotice autospec: pullrebase localreponotice
rm -f results/*src.rpm rm -f results/*src.rpm
@if [ -e $(SPECFILE) ] && ! grep -q "# Generated by: autospec.py" $(SPECFILE) ; then \ @if [ -e $(SPECFILE) ] && ! grep -q "# Generated by: autospec.py" $(SPECFILE) ; then \
@@ -166,6 +168,7 @@ autospec: pullrebase localreponotice
--name $(PKG_NAME) \ --name $(PKG_NAME) \
--archives $(ARCHIVES) \ --archives $(ARCHIVES) \
--mock-config $(MOCK_CONFIG_VAL) \ --mock-config $(MOCK_CONFIG_VAL) \
--mock-opts "$(MOCK_OPTS)" \
$${SETVERSION:+ --version $${SETVERSION}} \ $${SETVERSION:+ --version $${SETVERSION}} \
${NON_INTERACTIVE} ${SKIP_GIT} ${CLEANUP} \ ${NON_INTERACTIVE} ${SKIP_GIT} ${CLEANUP} \
$(firstword $(NEWURL) $(URL)); $(firstword $(NEWURL) $(URL));
@@ -209,7 +212,7 @@ $(__missingsources): sources
define fetch-from-srpm define fetch-from-srpm
tmp=$$(mktemp -d -p "."); \ tmp=$$(mktemp -d -p "."); \
srpm=$$(rpmspec --srpm -q --qf "%{NVR}.src.rpm\n" $(SPECFILE)); \ srpm=$$(rpmspec --srpm -q --qf "%{NVR}.src.rpm\n" $(SPECFILE)); \
if cd "$$tmp" && ! curl -s -S -f -L -O $(DOWNLOAD_MIRROR)/releases/$(1)/clear/source/SRPMS/$$srpm; then \ if cd "$$tmp" && ! curl -s -S -f -L -O $(MIRROR_CURL_OPTS) $(DOWNLOAD_MIRROR)/releases/$(1)/clear/source/SRPMS/$$srpm; then \
echo "Failed to download $$srpm from Clear Linux release $(1)." >&2; \ echo "Failed to download $$srpm from Clear Linux release $(1)." >&2; \
cd .. && rm -rf "$$tmp"; \ cd .. && rm -rf "$$tmp"; \
exit 1; \ exit 1; \
@@ -246,7 +249,7 @@ sources: upstream
*://*) n="$$u" ;; \ *://*) n="$$u" ;; \
*) n="$(SOURCES_URL)/$$u" ;; \ *) n="$(SOURCES_URL)/$$u" ;; \
esac; \ esac; \
if ! curl --fail -L "$$n" -o `basename "$$n"`; then \ if ! curl --fail -L -o `basename "$$n"` $(SOURCES_CURL_OPTS) "$$n"; then \
echo "Failed to download $$n"; \ echo "Failed to download $$n"; \
exit 1; \ exit 1; \
fi; \ fi; \
@@ -260,7 +263,7 @@ sources:
for b in $$latest_builds; do \ for b in $$latest_builds; do \
url="$(DOWNLOAD_MIRROR)/releases/$$b/clear/source/package-sources"; \ url="$(DOWNLOAD_MIRROR)/releases/$$b/clear/source/package-sources"; \
echo "Checking for source files in build $$b ..."; \ echo "Checking for source files in build $$b ..."; \
if grep -q "$$nvr" <(curl -s -f -L $$url); then \ if grep -q "$$nvr" <(curl -s -f -L $(MIRROR_CURL_OPTS) $$url); then \
$(call fetch-from-srpm,$$b); \ $(call fetch-from-srpm,$$b); \
if [ $$? -eq 0 ]; then \ if [ $$? -eq 0 ]; then \
echo "Source files retrieved from build $$b"; \ echo "Source files retrieved from build $$b"; \
@@ -283,8 +286,10 @@ koji: prekoji-checks kojidef
@if ! git branch | grep -q -E '^\* master'; then \ @if ! git branch | grep -q -E '^\* master'; then \
echo "Error: Must be on the master branch to submit to koji" >&2; \ echo "Error: Must be on the master branch to submit to koji" >&2; \
exit 1; \ exit 1; \
fi; \
if git rev-parse --verify --quiet origin/master > /dev/null; then \
git pull --rebase; \
fi fi
git pull --rebase
git tag $(SRPMVERS) git tag $(SRPMVERS)
git push origin master refs/tags/$(SRPMVERS) git push origin master refs/tags/$(SRPMVERS)
$(KOJI_CMD) build $$KOJI_NOWAIT $(KOJI_TAG) $(PKG_BASE_URL)/$(PKG_NAME)?#$(SRPMVERS) $(KOJI_CMD) build $$KOJI_NOWAIT $(KOJI_TAG) $(PKG_BASE_URL)/$(PKG_NAME)?#$(SRPMVERS)
@@ -388,15 +393,17 @@ install:
#help generateupstream: Run this rule to create or update the 'upstream' file #help generateupstream: Run this rule to create or update the 'upstream' file
#help by downloading the upstream source tarballs listed in the spec file and #help by downloading the upstream source tarballs listed in the spec file and
#help calculating their hashes. Autospec performs this step automatically, so ignore #help calculating their hashes. Autospec performs this step automatically, so
#help it for packages managed with autospec. #help ignore it for packages managed with autospec. Additional curl options
#help may be used for downloading the upstream source tarballs by defining the
#help CURL_OPTS variable for this rule.
generateupstream: generateupstream:
@[ -e upstream ] && mv upstream upstream.bak; \ @[ -e upstream ] && mv upstream upstream.bak; \
urls=$$(rpmspec -D '_vendor clr' -P $(SPECFILE) | sed -n "s|^Source[0-9]*[[:blank:]]*:[[:blank:]]*\(..*://..*\)$$|\1|p"); \ urls=$$(rpmspec -D '_vendor clr' -P $(SPECFILE) | sed -n "s|^Source[0-9]*[[:blank:]]*:[[:blank:]]*\(..*://..*\)$$|\1|p"); \
for url in $$urls; do \ for url in $$urls; do \
filename=$$(basename $$url); \ filename=$$(basename $$url); \
if [ ! -e $$filename ]; then \ if [ ! -e $$filename ]; then \
if ! curl --fail -L -O $$url; then \ if ! curl --fail -L -O $(CURL_OPTS) $$url; then \
echo "Failed to download $$url"; \ echo "Failed to download $$url"; \
[ -e upstream.bak ] && mv --no-clobber upstream.bak upstream; \ [ -e upstream.bak ] && mv --no-clobber upstream.bak upstream; \
exit 1; \ exit 1; \
+6
View File
@@ -26,6 +26,9 @@ CGIT_BASE_URL =
# Location of upstream tarball cache used by 'make build', 'make sources', etc. # Location of upstream tarball cache used by 'make build', 'make sources', etc.
SOURCES_URL = SOURCES_URL =
# Additional curl options to use when downloading files from SOURCES_URL
SOURCES_CURL_OPTS =
# Location where package repos are hosted. # Location where package repos are hosted.
PKG_BASE_URL = https://github.com/clearlinux-pkgs PKG_BASE_URL = https://github.com/clearlinux-pkgs
@@ -38,6 +41,9 @@ PROJ_PKGS = autospec clr-bundles common
# Clear Linux download mirror to use # Clear Linux download mirror to use
DOWNLOAD_MIRROR = https://cdn.download.clearlinux.org DOWNLOAD_MIRROR = https://cdn.download.clearlinux.org
# Additional curl options to use when downloading files from DOWNLOAD_MIRROR
MIRROR_CURL_OPTS =
# Location of release content from latest Clear Linux release # Location of release content from latest Clear Linux release
LATEST_RELEASE = $(DOWNLOAD_MIRROR)/current LATEST_RELEASE = $(DOWNLOAD_MIRROR)/current
+6 -1
View File
@@ -191,12 +191,16 @@ provides:
#help autospecnew: Creates a new autospec package with for a given URL=$(URL) #help autospecnew: Creates a new autospec package with for a given URL=$(URL)
#help with NAME=$(NAME). Several files used by autospec will be created in the #help with NAME=$(NAME). Several files used by autospec will be created in the
#help process. For more information about autospec, see the project page on Github https://github.com/clearlinux/autospec #help process.
#help Use MOCK_OPTS environment varible to pass down arbitrary mock options
#help to autospec.
#help For more information about autospec, see the project page on Github https://github.com/clearlinux/autospec
autospecnew: localreponotice autospecnew: localreponotice
@if [ -z $(NAME) ] || [ -z $(URL) ]; then \ @if [ -z $(NAME) ] || [ -z $(URL) ]; then \
echo "Please specify NAME and URL. The ARCHIVES variable is optional."; \ echo "Please specify NAME and URL. The ARCHIVES variable is optional."; \
exit 1; \ exit 1; \
fi fi
-$(MAKE) clone_$(NAME)
@if [ ! -d $(TOPLVL)/packages/$(NAME)/.git ]; then \ @if [ ! -d $(TOPLVL)/packages/$(NAME)/.git ]; then \
echo "no remote repository found, creating new package repository and running autospec"; \ echo "no remote repository found, creating new package repository and running autospec"; \
mkdir -p $(TOPLVL)/packages/$(NAME); \ mkdir -p $(TOPLVL)/packages/$(NAME); \
@@ -215,6 +219,7 @@ autospecnew: localreponotice
--name $(NAME) \ --name $(NAME) \
--archives $(ARCHIVES) \ --archives $(ARCHIVES) \
--mock-config $(MOCK_CONFIG_VAL) \ --mock-config $(MOCK_CONFIG_VAL) \
--mock-opts "$(MOCK_OPTS)" \
$${SETVERSION:+ --version $${SETVERSION}} \ $${SETVERSION:+ --version $${SETVERSION}} \
${NON_INTERACTIVE} ${SKIP_GIT} ${CLEANUP} \ ${NON_INTERACTIVE} ${SKIP_GIT} ${CLEANUP} \
$(URL); \ $(URL); \
+47 -36
View File
@@ -31,43 +31,13 @@ $ ./user-setup.sh
After the script completes, make sure to logout and login again to complete the After the script completes, make sure to logout and login again to complete the
setup process. setup process.
The script either accepts no options, or all (3) options in case you are The script accepts several options, or no options at all. The options are
configuring the Koji CLI for remote building on a Koji server. The options are documented in the script's `--help` output. Note that if you are supplying any
documented in the script's `--help` output. of the three Koji cert options (`-k`, `-s`, or `-c`), the other two options
must be supplied as well.
### Manual setup If you do not wish to run the user-setup script, see the "Manual setup" section
below for hints about how to initialize the tooling workspace.
On your Clear Linux system, create a workspace for Clear Linux development
work:
```
$ mkdir clearlinux
```
Clone this repo into a `projects` directory within the workspace:
```
$ cd clearlinux
$ mkdir projects
$ git clone https://github.com/clearlinux/common projects/common
```
Create the toplevel tooling Makefile:
```
$ ln -s projects/common/Makefile.toplevel Makefile
```
Clone all Clear Linux package and project repositories:
```
$ make clone
```
Note: You can clone the repos in parallel by using make's `-j` option.
At this point, the `packages` directory will contain all Clear Linux package
repos, and `projects` will contain common, clr-bundles, and autospec repos.
## Example usage ## Example usage
@@ -141,3 +111,44 @@ package, a `make bump` command is available for this purpose.
$ make bump $ make bump
$ make build $ make build
``` ```
## Other topics
### Manual setup
If you did not run the user-setup script (see "Automated setup" section above),
you will want to set up the developer tooling workspace manually. This section
provides general documentation for the manual setup process, and it is not
meant to be exhaustive.
On your Clear Linux system, create a workspace for Clear Linux development
work:
```
$ mkdir clearlinux
```
Clone this repo into a `projects` directory within the workspace:
```
$ cd clearlinux
$ mkdir projects
$ git clone https://github.com/clearlinux/common projects/common
```
Create the toplevel tooling Makefile:
```
$ ln -s projects/common/Makefile.toplevel Makefile
```
Clone all Clear Linux package and project repositories:
```
$ make clone
```
Note: You can clone the repos in parallel by using make's `-j` option.
At this point, the `packages` directory will contain all Clear Linux package
repos, and `projects` will contain common, clr-bundles, and autospec repos.
+44 -27
View File
@@ -596,6 +596,7 @@ backports.weakref
baobab baobab
bash bash
bash-completion bash-completion
bash.static
bash_kernel bash_kernel
bashdb bashdb
bats bats
@@ -605,7 +606,6 @@ bcrypt
bdftopcf bdftopcf
beautifulsoup4 beautifulsoup4
beignet beignet
bigreqsproto
bind-utils bind-utils
binutils binutils
bison bison
@@ -654,6 +654,8 @@ cgit
chardet chardet
check check
cheese cheese
cheroot
cherrypy
chrome-gnome-shell chrome-gnome-shell
chrony chrony
chrpath chrpath
@@ -700,9 +702,11 @@ colord
colord-gtk colord-gtk
comedilib comedilib
compat-SDL2-soname1 compat-SDL2-soname1
compat-cryptsetup-soname4
compat-efivar-soname0 compat-efivar-soname0
compat-fuse-soname2 compat-fuse-soname2
compat-gegl compat-gegl
compat-gegl-0.3
compat-glew-soname1 compat-glew-soname1
compat-gtksourceview-soname3 compat-gtksourceview-soname3
compat-guile-soname20 compat-guile-soname20
@@ -718,10 +722,10 @@ compat-opencv-soname33
compat-protobuf-soname14 compat-protobuf-soname14
compat-readline compat-readline
component component
compositeproto
compute-image-packages compute-image-packages
configobj configobj
configparser configparser
confuse
connect-proxy connect-proxy
connman connman
connman-gtk connman-gtk
@@ -752,8 +756,8 @@ cups-filters
cups-pk-helper cups-pk-helper
curl curl
cve-check-tool cve-check-tool
cxxfilt
cycler cycler
damageproto
dapl dapl
darktable darktable
dask dask
@@ -774,8 +778,8 @@ diffoscope
diffstat diffstat
diffutils diffutils
dist-pam-configs dist-pam-configs
dmenu
dmidecode dmidecode
dmxproto
dnf dnf
dnf-plugins-core dnf-plugins-core
dnsmasq dnsmasq
@@ -793,10 +797,9 @@ double-conversion
doxygen doxygen
dpdk dpdk
dracut dracut
dri2proto
dri3proto
dstat dstat
dtc dtc
dyskctl
e2fsprogs e2fsprogs
ebtables ebtables
ecdsa ecdsa
@@ -842,7 +845,6 @@ findutils
fio fio
firefox firefox
fish fish
fixesproto
fixtures fixtures
flac flac
flake8 flake8
@@ -858,7 +860,6 @@ font-adobe-75dpi
font-bitstream-type1 font-bitstream-type1
font-util font-util
fontconfig fontconfig
fontsproto
freeglut freeglut
freeipmi freeipmi
freetype freetype
@@ -868,6 +869,8 @@ funcsigs
functools32 functools32
fuse fuse
futures futures
fwupd
fwupdate
garcon garcon
gast gast
gawk gawk
@@ -906,7 +909,6 @@ glibc
glibmm glibmm
global global
glog glog
glproto
glslang glslang
glu glu
glusterfs glusterfs
@@ -1028,6 +1030,9 @@ hyperscan
hyperstart hyperstart
hypothesis hypothesis
i2c-tools i2c-tools
i3
i3lock
i3status
ibus ibus
icalendar icalendar
icdiff icdiff
@@ -1039,10 +1044,12 @@ imagesize
imapfilter imapfilter
indent indent
infiniband-diags infiniband-diags
influxdb
iniparse iniparse
init-rdahead init-rdahead
inotify-tools inotify-tools
inputproto intel-gpu-tools
intel-hybrid-driver
intltool intltool
invm-frameworks invm-frameworks
ioping ioping
@@ -1096,7 +1103,6 @@ jupyterlab
jupyterlab_launcher jupyterlab_launcher
kafka-dep kafka-dep
kbd kbd
kbproto
kernel-install kernel-install
kexec-tools kexec-tools
keyring keyring
@@ -1168,6 +1174,7 @@ libdmx
libdnf libdnf
libdrm libdrm
libepoxy libepoxy
libev
libevdev libevdev
libevent libevent
libexif libexif
@@ -1180,6 +1187,7 @@ libgee
libgepub libgepub
libgfortran-avx libgfortran-avx
libgfortran-compat-soname3 libgfortran-compat-soname3
libgfortran-compat-soname4
libgit2 libgit2
libglade libglade
libgnome-keyring libgnome-keyring
@@ -1203,6 +1211,7 @@ libmediaart
libmnl libmnl
libmspack libmspack
libmtp libmtp
libmypaint
libndp libndp
libnetfilter_conntrack libnetfilter_conntrack
libnetfilter_cthelper libnetfilter_cthelper
@@ -1231,6 +1240,8 @@ libsass
libseccomp libseccomp
libsecret libsecret
libsigc++ libsigc++
libsmbios
libsmi
libsndfile libsndfile
libsolv libsolv
libsoup libsoup
@@ -1272,6 +1283,7 @@ libxml2-legacy
libxshmfence libxshmfence
libxslt libxslt
libyami libyami
libyami-utils
libzip libzip
linecache2 linecache2
links links
@@ -1326,6 +1338,7 @@ meson
metacity metacity
micro-config-drive micro-config-drive
micro-config-drive-aws micro-config-drive-aws
micro-config-drive-oci
mido mido
minetest minetest
minetest_game minetest_game
@@ -1338,6 +1351,7 @@ mkosi
mock mock
mod_wsgi mod_wsgi
moka-icon-theme moka-icon-theme
more-itertools
mosh mosh
motd-update motd-update
motif motif
@@ -1347,6 +1361,7 @@ mozjs52
mpc mpc
mpfr mpfr
mpg123 mpg123
mpi4py
msgpack-python msgpack-python
msmtp msmtp
msr-tools msr-tools
@@ -1358,6 +1373,7 @@ murrine
musl musl
mutt mutt
mutter mutter
mypaint-brushes
mypy mypy
nagios-plugins nagios-plugins
nano nano
@@ -1390,6 +1406,7 @@ ninja
nlopt nlopt
nodejs nodejs
nose nose
nose-cov
nose-parameterized nose-parameterized
nosync nosync
notebook notebook
@@ -1403,10 +1420,12 @@ nss
nss-altfiles nss-altfiles
ntfs-3g ntfs-3g
numactl numactl
numatop
numba numba
numpy numpy
numpydoc numpydoc
nvme-cli nvme-cli
oath-toolkit
oauth2client oauth2client
ocl-icd ocl-icd
offlineimap offlineimap
@@ -1436,6 +1455,7 @@ opusfile
orc orc
orca orca
ordereddict ordereddict
osinfo-db-tools
ostree ostree
ovirt-guest-agent ovirt-guest-agent
p11-kit p11-kit
@@ -1596,13 +1616,14 @@ ply
pmdk pmdk
polkit polkit
poppler poppler
poppler-data
popt popt
portaudio portaudio
portend
posix_ipc posix_ipc
postgresql postgresql
powerline-fonts powerline-fonts
powertop powertop
presentproto
pretend pretend
prettytable prettytable
proc-macro2 proc-macro2
@@ -1708,17 +1729,14 @@ qtxmlpatterns
quagga quagga
quilt quilt
ragel ragel
randrproto
rdma-core rdma-core
re2c re2c
readline readline
recordproto
redis redis
redis-native redis-native
redsocks redsocks
renderproto
requests requests
resourceproto requests-mock
rest rest
retry_decorator retry_decorator
retype retype
@@ -1751,20 +1769,22 @@ scipy
scons scons
screen screen
scripttest scripttest
scrnsaverproto
seaborn seaborn
seahorse seahorse
secretstorage secretstorage
sed sed
serf
setproctitle setproctitle
setserial setserial
setuptools setuptools
setuptools_scm setuptools_scm
setuptools_scm_git_archive
shadow shadow
shared-mime-info shared-mime-info
sharutils sharutils
shim shim
siege siege
simg-tools
simple-scan simple-scan
simplegeneric simplegeneric
simplejson simplejson
@@ -1781,6 +1801,7 @@ soundmodem
source-code-pro source-code-pro
source-highlight source-highlight
sox sox
spandsp
spark-dep spark-dep
speex speex
speexdsp speexdsp
@@ -1824,6 +1845,7 @@ tcpdump
telemetrics-client telemetrics-client
telepathy-glib telepathy-glib
telepathy-logger telepathy-logger
tempora
tensorboard tensorboard
tensorflow tensorflow
termcolor termcolor
@@ -1888,7 +1910,6 @@ v4l-utils
vala vala
valgrind valgrind
vcversioner vcversioner
videoproto
vim vim
vim-go vim-go
vinagre vinagre
@@ -1898,7 +1919,6 @@ virt-viewer
virtualenv virtualenv
vlc vlc
volume_key volume_key
vorbis-tools
vsqlite vsqlite
vte vte
vulkan-sdk vulkan-sdk
@@ -1918,6 +1938,7 @@ wheel
which which
widgetsnbextension widgetsnbextension
wireless-regdb-master wireless-regdb-master
wireshark
woff2 woff2
wol wol
wpa_supplicant wpa_supplicant
@@ -1930,11 +1951,13 @@ xauth
xbitmaps xbitmaps
xcb-proto xcb-proto
xcb-util xcb-util
xcb-util-cursor
xcb-util-image xcb-util-image
xcb-util-keysyms xcb-util-keysyms
xcb-util-renderutil
xcb-util-wm xcb-util-wm
xcb-util-xrm
xclip xclip
xcmiscproto
xcursor-themes xcursor-themes
xcursorgen xcursorgen
xdg-desktop-portal xdg-desktop-portal
@@ -1942,7 +1965,6 @@ xdg-user-dirs
xdg-user-dirs-gtk xdg-user-dirs-gtk
xdg-utils xdg-utils
xemacs xemacs
xextproto
xf86-input-evdev xf86-input-evdev
xf86-input-libinput xf86-input-libinput
xf86-input-mouse xf86-input-mouse
@@ -1953,10 +1975,6 @@ xf86-video-ati
xf86-video-fbdev xf86-video-fbdev
xf86-video-nouveau xf86-video-nouveau
xf86-video-vesa xf86-video-vesa
xf86bigfontproto
xf86dgaproto
xf86driproto
xf86vidmodeproto
xfburn xfburn
xfce4-appfinder xfce4-appfinder
xfce4-dev-tools xfce4-dev-tools
@@ -1972,7 +1990,6 @@ xfdesktop
xfsprogs xfsprogs
xfwm4 xfwm4
xhost xhost
xineramaproto
xinit xinit
xkbcomp xkbcomp
xkeyboard-config xkeyboard-config
@@ -1981,8 +1998,8 @@ xmlsec1
xmlstarlet xmlstarlet
xmlto xmlto
xorg-server xorg-server
xorgproto
xorriso xorriso
xproto
xrandr xrandr
xrdb xrdb
xrdp xrdp
+133 -97
View File
@@ -1,102 +1,131 @@
#!/bin/sh #!/bin/bash
SCRIPT=$(/usr/bin/basename $0) SCRIPT=$(/usr/bin/basename $0)
PEM="" PEM=""
SERVERCA="" SERVERCA=""
CLIENTCA="" CLIENTCA=""
WORKSPACE="clearlinux"
PACKAGE_REPOS=
help() { help() {
printf "%s\n" >&2 "Usage: $SCRIPT [options]" \ printf "%s\n" >&2 "Usage: $SCRIPT [options]" \
"" \ "" \
"Options:" \ "Options:" \
"-k --client-cert PEM_FILE: Enable client user cert for koji configuration; requires a PEM file argument" \ "" \
"-s --server-ca PEM_FILE: Enable server CA cert for koji configuration; requires a PEM file argument" \ "-d --directory NAME: Set up workspace in the given directory." \
"-c --client-ca PEM_FILE: Enable client CA cert for koji configuration; requires a PEM file argument" \ "-a --clone-packages: Clone all package repos." \
"" "-j --jobs [NUM]: Clone repos with NUM jobs. If NUM is not given, it is set to the available CPU count." \
"" \
"-k --client-cert PEM_FILE: Enable client user cert for koji configuration; requires a PEM file argument" \
"-s --server-ca PEM_FILE: Enable server CA cert for koji configuration; requires a PEM file argument" \
"-c --client-ca PEM_FILE: Enable client CA cert for koji configuration; requires a PEM file argument" \
""
}
error() {
echo -e "Error: $1\n" >&2
help
exit 1
} }
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
"--help"|"-h") "--help"|"-h")
help help
exit 0 exit 0
;; ;;
"--client-cert"|"-k") "--client-cert"|"-k")
shift shift
PEM="$PWD/$1" PEM="$PWD/$1"
;; ;;
"--server-ca"|"-s") "--server-ca"|"-s")
shift shift
SERVERCA="$PWD/$1" SERVERCA="$PWD/$1"
;; ;;
"--client-ca"|"-c") "--client-ca"|"-c")
shift shift
CLIENTCA="$PWD/$1" CLIENTCA="$PWD/$1"
;; ;;
*) "--jobs"|"-j")
help if echo "$2" | grep -qx "[1-9][0-9]*"; then
exit 1 shift
;; JOBS="$1"
esac elif [ -f /proc/cpuinfo ]; then
shift JOBS=$(grep -Ec '^processor.*:.*[0-9]+$' /proc/cpuinfo)
fi
;;
"--directory"|"-d")
[ -z "$2" ] && error "Must supply a directory name to the -d option"
[ "${2:0:1}" = "-" ] && error "Directory name cannot begin with \"-\""
shift
WORKSPACE="$1"
;;
"--clone-packages"|"-a")
PACKAGE_REPOS=1
;;
*)
help
exit 1
;;
esac
shift
done done
error() {
echo -e "Error: $1\n" >&2
help
exit 1
}
if [ -z "$PEM" ] && [ -z "$SERVERCA" ] && [ -z "$CLIENTCA" ]; then if [ -z "$PEM" ] && [ -z "$SERVERCA" ] && [ -z "$CLIENTCA" ]; then
USE_KOJI= USE_KOJI=
else else
if [ -z "$PEM" ] || [ -z "$SERVERCA" ] || [ -z "$CLIENTCA" ]; then if [ -z "$PEM" ] || [ -z "$SERVERCA" ] || [ -z "$CLIENTCA" ]; then
error "Must specify all three command line options (or none)" error "Must specify all three command line options (or none)"
fi fi
if [ ! -f "$PEM" ]; then if [ ! -f "$PEM" ]; then
error "Missing koji client PEM key file" error "Missing koji client PEM key file"
fi fi
if [ ! -f "$SERVERCA" ]; then if [ ! -f "$SERVERCA" ]; then
error "Missing koji server CA PEM file" error "Missing koji server CA PEM file"
fi fi
if [ ! -f "$CLIENTCA" ]; then if [ ! -f "$CLIENTCA" ]; then
error "Missing koji client CA PEM file" error "Missing koji client CA PEM file"
fi fi
USE_KOJI="yes" USE_KOJI="yes"
fi
if [ -n "$JOBS" ]; then
JOBS_ARG="-j $JOBS"
fi
if [ -d "$WORKSPACE" ]; then
error "Directory \"$WORKSPACE\" already exists. \
Either remove this workspace, or use a different workspace name."
fi fi
required_progs() { required_progs() {
local bindir="/usr/bin" local bindir="/usr/bin"
for f in git mock rpm rpmbuild ; do for f in git mock rpm rpmbuild ; do
[ ! -x "${bindir}/${f}" ] && missing+="${f} " [ ! -x "${bindir}/${f}" ] && missing+="${f} "
done done
[ "$PEM" ] && [ ! -x /usr/bin/koji ] && missing+="koji " [ "$PEM" ] && [ ! -x /usr/bin/koji ] && missing+="koji "
if [ -n "$missing" ]; then if [ -n "$missing" ]; then
echo "Install the following programs and re-run this script:" >&2 echo "Install the following programs and re-run this script:" >&2
echo $missing >&2 echo $missing >&2
echo 'All programs should be provided in the "os-clr-on-clr" bundle.' >&2 echo 'All programs should be provided in the "os-clr-on-clr" bundle.' >&2
exit 1 exit 1
fi fi
} }
required_progs required_progs
echo 'Initializing development workspace in "clearlinux" . . .' echo "Initializing development workspace in \"$WORKSPACE\" . . ."
if [ -d "clearlinux" ]; then
echo 'Directory "clearlinux" already exists in current directory.' >&2
echo "Cannot initialize workspace." >&2
exit 1
fi
mkdir clearlinux mkdir "$WORKSPACE"
cd clearlinux cd "$WORKSPACE"
echo "Setting up common repo . . ." echo "Setting up common repo . . ."
mkdir projects mkdir projects
git clone https://github.com/clearlinux/common projects/common git clone https://github.com/clearlinux/common projects/common
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Failed to clone common repo." >&2 echo "Failed to clone common repo." >&2
exit 1 exit 1
fi fi
# Finish setup for packages/projects hierarchy # Finish setup for packages/projects hierarchy
@@ -105,48 +134,55 @@ mkdir -p packages/common
ln -sf ../../projects/common/Makefile.common packages/common/Makefile.common ln -sf ../../projects/common/Makefile.common packages/common/Makefile.common
if [ "$USE_KOJI" ]; then if [ "$USE_KOJI" ]; then
echo "Setting up koji certs . . ." echo "Setting up koji certs . . ."
mkdir -p ~/.koji mkdir -p ~/.koji
cp "$PEM" ~/.koji/client.crt cp "$PEM" ~/.koji/client.crt
cp "$CLIENTCA" ~/.koji/clientca.crt cp "$CLIENTCA" ~/.koji/clientca.crt
cp "$SERVERCA" ~/.koji/serverca.crt cp "$SERVERCA" ~/.koji/serverca.crt
if [ ! -f /etc/koji.conf ]; then if [ ! -f /etc/koji.conf ]; then
echo "Setting up koji config . . ." echo "Setting up koji config . . ."
sudo cp projects/common/koji-client-files/koji.conf /etc sudo cp projects/common/koji-client-files/koji.conf /etc
fi fi
fi fi
if [ ! -f /etc/mock/clear.cfg ]; then if [ ! -f /etc/mock/clear.cfg ]; then
echo "Setting up mock config . . ." echo "Setting up mock config . . ."
sudo mkdir -p /etc/mock sudo mkdir -p /etc/mock
sudo cp projects/common/koji-client-files/clear.cfg /etc/mock sudo cp projects/common/koji-client-files/clear.cfg /etc/mock
fi fi
echo "Adding user to kvm group . . ." echo "Adding user to kvm group . . ."
sudo usermod -a -G kvm $USER sudo usermod -a -G kvm $USER
echo "Cloning special project repositories . . ." echo "Cloning special project repositories . . ."
make clone-projects make ${JOBS_ARG} clone-projects
if [ -z "$NO_PACKAGE_REPOS" ]; then if [ -n "$PACKAGE_REPOS" ]; then
echo "Cloning all package repositories . . ." echo "Cloning all package repositories . . ."
make clone-packages make ${JOBS_ARG} clone-packages
fi fi
if [ "$USE_KOJI" ]; then if [ "$USE_KOJI" ]; then
echo "Testing koji installation . . ." echo "Testing koji installation . . ."
if koji moshimoshi; then if koji moshimoshi; then
echo -en "\n************************\n\n" echo -en "\n************************\n\n"
echo "Koji installed and configured successfully" echo "Koji installed and configured successfully"
else else
echo -en "\n************************\n\n" echo -en "\n************************\n\n"
echo "Error with koji installation or configuration" >&2 echo "Error with koji installation or configuration" >&2
exit 1 exit 1
fi fi
fi fi
echo -en "\n************************\n" echo -en "\n************************\n"
echo 'Workspace has been set up in the "clearlinux" directory' echo "Workspace has been set up in \"$WORKSPACE\""
if [ -z "$PACKAGE_REPOS" ]; then
echo "NOTE: To clone all package repos, run \"cd $WORKSPACE; make [-j NUM] clone-packages\""
echo "NOTE: To clone a single package repo with NAME, run \"cd $WORKSPACE; make clone_NAME\""
fi
echo 'NOTE: logout and log back in to finalize the setup process' echo 'NOTE: logout and log back in to finalize the setup process'
# vi: ft=sh sw=2 et sts=2