diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/create-modulemd.sh b/create-modulemd.sh new file mode 100755 index 0000000..4d3cbfd --- /dev/null +++ b/create-modulemd.sh @@ -0,0 +1,283 @@ +#!/bin/bash +# +#TODO: output api +# +# Walkthrough: +# - get a list of srpm package names that are included in BRT +# - loop until ".end" got entered: +# - read newpackage from stdin +# - check if newpackage is in brtsrpms list > next loop +# - check if newpackage is in module rpm list > next loop +# - get build deps from newpackage +# - loop over build deps: +# - check if build dep is in brtsrpms list > next loop +# - check if build dep is in module rpm list > next loop +# - otherwise add build dep to module rpm list +# and output modulemd snipped with rpm name and rationale + + +## #get a list of build deps from a certain binary rpm: +## repoquery --disablerepo=Dropbox --releasever 26 --requires --recursive --resolve --qf "%{SOURCERPM}" vim-minimal | sort -n | uniq + +binaryrpm="" +modulerpms=() +modulerpmsfile=`mktemp modulerpms.XXX` +moduleapifile=`mktemp moduleapi.XXX` +moduleprofilefile=`mktemp moduleprofile.XXX` +alreadyprocessed=`mktemp moduledepprocessed.XXX` +brtrepo="https://kojipkgs.stg.fedoraproject.org/compose/branched/jkaluza/latest-Boltron-26/compose/base-runtime/x86_64/os/" + +# add all common-build-dep packages and perl-module package here +solvedbuilddeps=("hostname" "multilib-rpm-config" "help2man" "autoconf" "automake" "golang" \ + "perl" "perl-Algorithm-Diff" "perl-Archive-Tar" "perl-Archive-Zip" "perl-B-Debug" \ + "perl-CPAN" "perl-CPAN-Meta" "perl-CPAN-Meta-Requirements" "perl-CPAN-Meta-YAML" \ + "perl-Carp" "perl-Compress-Bzip2" "perl-Compress-Raw-Bzip2" "perl-Compress-Raw-Zlib" \ + "perl-Config-Perl-V" "perl-DB_File" "perl-Data-Dumper" "perl-Data-OptList" "perl-Data-Section" \ + "perl-Devel-PPPort" "perl-Devel-Size" "perl-Digest" "perl-Digest-MD5" "perl-Digest-SHA" \ + "perl-Encode" "perl-Env" "perl-Exporter" "perl-ExtUtils-CBuilder" "perl-ExtUtils-Install" \ + "perl-ExtUtils-MakeMaker" "perl-ExtUtils-Manifest" "perl-ExtUtils-ParseXS" "perl-Fedora-VSP" \ + "perl-File-Fetch" "perl-File-HomeDir" "perl-File-Path" "perl-File-Temp" "perl-File-Which" \ + "perl-Filter" "perl-Filter-Simple" "perl-Getopt-Long" "perl-HTTP-Tiny" "perl-IO-Compress" \ + "perl-IO-Socket-IP" "perl-IPC-Cmd" "perl-IPC-SysV" "perl-IPC-System-Simple" "perl-JSON-PP" \ + "perl-Locale-Codes" "perl-Locale-Maketext" "perl-MIME-Base64" "perl-MRO-Compat" \ + "perl-Math-BigInt" "perl-Math-BigInt-FastCalc" "perl-Math-BigRat" "perl-Module-Build" \ + "perl-Module-CoreList" "perl-Module-Load" "perl-Module-Load-Conditional" \ + "perl-Module-Metadata" "perl-Package-Generator" "perl-Params-Check" "perl-Params-Util" \ + "perl-PathTools" "perl-Perl-OSType" "perl-PerlIO-via-QuotedPrint" "perl-Pod-Checker" \ + "perl-Pod-Escapes" "perl-Pod-Parser" "perl-Pod-Perldoc" "perl-Pod-Simple" "perl-Pod-Usage" \ + "perl-Scalar-List-Utils" "perl-Socket" "perl-Software-License" "perl-Storable" \ + "perl-Sub-Exporter" "perl-Sub-Install" "perl-Sys-Syslog" "perl-Term-ANSIColor" \ + "perl-Term-Cap" "perl-Test-Harness" "perl-Test-Simple" "perl-Test-Taint" \ + "perl-Text-Balanced" "perl-Text-Diff" "perl-Text-Glob" "perl-Text-ParseWords" \ + "perl-Text-Tabs+Wrap" "perl-Text-Template" "perl-Thread-Queue" "perl-Time-HiRes" \ + "perl-Time-Local" "perl-URI" "perl-Unicode-Collate" "perl-Unicode-Normalize" "perl-autodie" \ + "perl-bignum" "perl-constant" "perl-experimental" "perl-generators" "perl-inc-latest" \ + "perl-libnet" "perl-local-lib" "perl-parent" "perl-perlfaq" "perl-podlators" \ + "perl-srpm-macros" "perl-threads" "perl-threads-shared" "perl-version" \ + "imake" "cmake" "doxygen" "libusbx" "xorg-x11-proto-devel" "xorg-x11-util-macros" "xapian-core" "bison" \ + "python2" "tcl" "epydoc" "chrpath" "dbus-glib" "libcgroup" "checkpolicy" "policycoreutils" \ + "vala" "cups" "bluez" "git" "libical" "cups-filters" "docbook-dtds" "docbook-style-dsssl" "perl-SGMLSpm" \ + "libyaml" "xorg-x11-xtrans-devel" "libICE" "libXau" "xorg-x11-xbitmaps" "fontconfig" \ + "libglvnd" "jbigkit" "libjpeg-turbo" "libunwind" "libxcb" "pixman" "tcp_wrappers" "xorg-x11-proto-devel" ) + +# "desktop-file-utils" "python-cups" "gobject-introspection" "atk" +debug() { + echo "$@" 1>&2 +# return +} + +#usage: containsElement "blaha" "${array[@]}" +# returns 0 (true) if element is in array +# returns 1 (false) if element is not in array +containsElement () { + local e + for e in "${@:2}"; do [ "$e" == "$1" ] && return 0; done + return 1 +} + +gather_modulemd_rpms() { + if [ "${1}" != "" ]; then + debug "gather_modulemd_rpms adding ${1} to rpm list" + echo " ${1}:" >> $modulerpmsfile + echo " rationale: ${@:3}" >> $modulerpmsfile + echo " ref: f26" >> $modulerpmsfile + echo " buildorder: ${2}" >> $modulerpmsfile + fi +} + +gather_profile() { + if [ "${1}" != "" ]; then + debug "gather_profile adding ${1} to profile" + echo " - ${1}" >> $moduleprofilefile + fi +} + +gather_api() { + if [ "${1}" != "" ]; then + debug "gather_api adding ${1} to api" + echo " - ${1}" >> $moduleapifile + fi +} + +wget -N https://raw.githubusercontent.com/fedora-modularity/base-runtime/master/api.x86_64 +brtsrpms=(`grep -v -e "^+\|^*\|^-" api.x86_64 | sed -e "s/-[^-]*-[^-]*$//"`) +brtrpms=(`grep -e "^+\|^*" api.x86_64 | cut -f 2 | sed -e "s/-[^-]*-[^-]*$//"`) + +for binaryrpm in $*; do + debug "working on $binaryrpm" + if containsElement "$binaryrpm" "${brtrpms[@]}" ; then + debug "$binaryrpm is already in BRT" + continue + fi + if containsElement "$binaryrpm" "${modulerpms[@]}" ; then + debug "$binaryrpm is already in the list of deps for this module" + continue + fi + if containsElement "$binaryrpm" "${solvedbuilddeps[@]}" ; then + debug "$binaryrpm is already in common-build-deps or in bootstrap" + continue + fi + binaryrpm_srpm=`dnf repoquery --releasever 26 -q --qf "%{SOURCERPM}" --whatprovides "$binaryrpm" 2>/dev/null | tail -1 | sed -e "s/-[^-]*-[^-]*.src.rpm//"` + if [ "$binaryrpm_srpm" == "" ]; then + debug "no source rpm found for $binaryrpm" + continue + fi + gather_profile $binaryrpm + gather_api $binaryrpm + if ! containsElement "$binaryrpm" "${modulerpms[@]}" ; then + gather_modulemd_rpms $binaryrpm_srpm 10 "Component for shared userspace - $binaryrpm." + modulerpms+=($binaryrpm_srpm) + fi + # deps has a list of dependencies that the source RPM of a package given on the cmdline has + deps=`repoquery --enablerepo fedora-source --releasever 26 --arch src -q --requires $binaryrpm_srpm 2>/dev/null | sed -e "s/ .*$//"` + for dep in $deps; do + grep -q "$dep" $alreadyprocessed && continue + echo "$dep" >> $alreadyprocessed + # bdep is a binary package that provides one of the source rpm dependencies + bdep=`repoquery --releasever 26 -q --whatprovides "$dep" 2>/dev/null | tail -1 | sed -e "s/-[^-]*-[^-]*$//"` + if containsElement "$bdep" "${brtrpms[@]}" ; then + debug "$bdep is already in BRT" + continue + fi + + if containsElement "$bdep" "${modulerpms[@]}" ; then + debug "$bdep is already in the list of deps for this module" + continue + fi +# modulerpms+=($bdep) + # sdep is a source rpm that provides one of the dependencies of a package given on the cmdline (its srpm) + sdep=`repoquery --releasever 26 -q --qf "%{SOURCERPM}" --whatprovides "$dep" 2>/dev/null | tail -1 | sed -e "s/-[^-]*-[^-]*.src.rpm//"` + #debug "1 sdep: $sdep dep: $dep" + if containsElement "$sdep" "${solvedbuilddeps[@]}" ; then + debug "$sdep already in common-build-deps or in bootstrap" + continue + fi + # FIXME: is this correct ? : + if containsElement "$sdep" "${brtsrpms[@]}" ; then + debug "$sdep is already in BRT" + continue + fi + if ! containsElement "$sdep" "${modulerpms[@]}" ; then + debug "$sdep not in modulerpms, adding" + modulerpms+=($sdep) + gather_modulemd_rpms $sdep 5 "Requirement for ${binaryrpm}." + continue + fi + done +done + + +cat << EOT +document: modulemd +version: 1 +data: + summary: Shared Userspace Module + description: A module that contains libraries, binaries, etc + that are shared between all other modules. + license: + module: [ MIT ] + dependencies: + buildrequires: +# base-runtime: f26 + perl: master + common-build-dependencies-bootstrap: f26 + common-build-dependencies: f26 + bootstrap: master + requires: + base-runtime: master + perl: master + references: + community: https://fedoraproject.org/wiki/Modularity + documentation: https://fedoraproject.org/wiki/Fedora_Packaging_Guidelines_for_Modules + tracker: https://taiga.fedorainfracloud.org/project/modularity + profiles: + default: + rpms: +EOT +cat $moduleprofilefile +cat << EOT + api: + rpms: +EOT +cat $moduleapifile +cat << EOT + filter: + rpms: + - clang-analyzer + - cups-client + - cups-ipptool + - cups-lpd + - boost-doctools + - boost-graph-mpich + - boost-graph-openmpi + - boost-mpich-devel + - boost-mpich + - boost-openmpi-devel + - boost-openmpi-python + - boost-mpich-python + - git-all + - git-cvs + - git-email + - git-gui + - gtk2-immodules + - libtool + - libtool-ltdl-devel + - perl-Git-SVN + - policycoreutils-gui +EOT +cat << EOT + components: + rpms: +# libtool provides libtool-ltdl, a runtime library: + libtool: + rationale: Build dep for many packages. + ref: f26 + buildorder: 1 + tcl: + rationale: dependency of python2. + ref: f26 + buildorder: 5 + glib2: + rationale: Build dep for many packages. + ref: f26 + buildorder: 4 +# desktop-file-utils need glib2 (and emacs) + desktop-file-utils: + rationale: dependency of cups/python-cups/epydoc/policycoreutils + ref: f26 + buildorder: 5 + epydoc: +# disabled dep on desktop-file-utils + rationale: dependency of cups/python-cups. + ref: f26 + buildorder: 7 + python2: + rationale: dependency of many packages. + ref: private-karsten-modularity + buildorder: 6 + chrpath: + rationale: dependency of dbus-glib. + ref: f26 + buildorder: 1 + dbus-glib: + rationale: dependency of policycoreutils. + ref: f26 + buildorder: 5 + libcgroup: + rationale: dependency of policycoreutils. + ref: f26 + buildorder: 2 + checkpolicy: + rationale: dependency of policycoreutils. + ref: f26 + buildorder: 2 + policycoreutils: + rationale: dependency of selinux-policy. + ref: f26 + buildorder: 6 +################################################################ +EOT +cat $modulerpmsfile + +rm -f $moduleprofilefile $moduleapifile $modulerpmsfile $alreadyprocessed + diff --git a/package.list b/package.list new file mode 100644 index 0000000..b79b751 --- /dev/null +++ b/package.list @@ -0,0 +1,430 @@ +alsa-lib alsa-lib +elfutils-libelf elfutils +glibc glibc +glibc-utils glibc +gtk2 gtk2 +hesiod hesiod +krb5-libs krb5 +libgcc gcc +libstdc++ gcc +libtbbmalloc_proxy tbb +libtbbmalloc tbb +libusb libusb +libvirt-client libvirt +libxml2 libxml2 +libxslt libxslt +mesa-libGL mesa +mesa-libGLU mesa-libGLU +motif motif +pam pam +SDL SDL +acl acl +atomic atomic +atomic-devmode atomic-devmode +attr attr +audit-libs audit +audit-libs-python audit +authconfig authconfig +avahi-libs avahi +basesystem basesystem +bash bash +bash-completion bash-completion +bind-libs bind +bind-libs-lite bind +bind-license bind +bind-utils bind +biosdevname biosdevname +boost-iostreams boost +boost-program-options boost +boost-random boost +boost-regex boost +boost-system boost +boost-thread boost +bridge-utils bridge-utils +bzip2 bzip2 +bzip2-libs bzip2 +ca-certificates ca-certificates +c-ares c-ares +ceph-common ceph +checkpolicy checkpolicy +chkconfig chkconfig +chrony chrony +cloud-init cloud-init +cloud-utils-growpart cloud-utils +cockpit-bridge cockpit +cockpit-docker cockpit +cockpit-ostree cockpit +cockpit-system cockpit +conntrack-tools conntrack-tools +container-selinux docker +coreutils coreutils +cpio cpio +cracklib cracklib +cracklib-dicts cracklib +criu criu +cronie cronie +cronie-anacron cronie +crontabs crontabs +cryptsetup cryptsetup +cryptsetup-libs cryptsetup +cups-libs cups +curl curl +cyrus-sasl-gssapi cyrus-sasl +cyrus-sasl-lib cyrus-sasl +dbus dbus +dbus-glib dbus +dbus-libs dbus +dbus-python dbus-python +device-mapper lvm2 +device-mapper-event lvm2 +device-mapper-event-libs lvm2 +device-mapper-libs lvm2 +device-mapper-multipath device-mapper-multipath +device-mapper-multipath-libs device-mapper-multipath +device-mapper-persistent-data device-mapper-persistent-data +dhclient dhcp +dhcp-common dhcp +dhcp-libs dhcp +diffutils diffutils +dmidecode dmidecode +dnsmasq dnsmasq +docker docker +docker-client docker-client +docker-client-latest docker-latest +docker-common docker +docker-latest docker-latest +docker-lvm-plugin not found +docker-novolume-plugin docker +dracut dracut +dracut-network dracut +e2fsprogs e2fsprogs +e2fsprogs-libs e2fsprogs +efibootmgr efibootmgr +efivar-libs efivar +elfutils-libelf elfutils +elfutils-libs elfutils +etcd etcd +ethtool ethtool +expat expat +fcgi fcgi +file file +file-libs file +filesystem filesystem +findutils findutils +fipscheck fipscheck +fipscheck-lib fipscheck +flannel flannel +freetype freetype +fuse fuse +fuse-libs fuse +gawk gawk +gdbm gdbm +GeoIP GeoIP +gettext gettext +gettext-libs gettext +glib2 glib2 +glibc glibc +glibc-common glibc +glib-networking glib-networking +glusterfs glusterfs +glusterfs-client-xlators glusterfs +glusterfs-fuse glusterfs +glusterfs-libs glusterfs +gmp gmp +gnupg2 gnupg2 +gnutls gnutls +gobject-introspection gobject-introspection +gomtree gomtree +gperftools-libs gperftools +gpgme gpgme +grep grep +groff-base groff +grub2 grub2 +grub2-efi grub2 +grub2-tools grub2 +grubby grubby +gsettings-desktop-schemas gsettings-desktop-schemas +gssproxy gssproxy +gzip gzip +hardlink hardlink +hostname hostname +info texinfo +initscripts initscripts +iproute iproute +iptables iptables +iptables-services iptables +iputils iputils +irqbalance irqbalance +iscsi-initiator-utils iscsi-initiator-utils +iscsi-initiator-utils-iscsiuio iscsi-initiator-utils +jansson jansson +json-glib json-glib +kernel kernel +kexec-tools kexec-tools +keyutils keyutils +keyutils-libs keyutils +kmod kmod +kmod-libs kmod +kpartx device-mapper-multipath +krb5-libs krb5 +kubernetes-client kubernetes +kubernetes-node kubernetes +less less +libacl acl +libaio libaio +libarchive libarchive +libassuan libassuan +libattr attr +libbabeltrace babeltrace +libbasicobjects ding-libs +libblkid util-linux +libcap libcap +libcap-ng libcap-ng +libcephfs1 ceph +libcgroup libcgroup +libcollection ding-libs +libcom_err e2fsprogs +libcroco libcroco +libcurl curl +libdb libdb +libdb-utils libdb +libdhash ding-libs +libedit libedit +libevent libevent +libffi libffi +libgcc gcc +libgcrypt libgcrypt +libgomp gcc +libgpg-error libgpg-error +libgudev1 libgudev +libicu icu +libidn libidn +libini_config ding-libs +libipa_hbac sssd +libldb libldb +libmnl libmnl +libmodman libmodman +libmount util-linux +libndp libndp +libnetfilter_conntrack libnetfilter_conntrack +libnetfilter_cthelper libnetfilter_cthelper +libnetfilter_cttimeout libnetfilter_cttimeout +libnetfilter_queue libnetfilter_queue +libnfnetlink libnfnetlink +libnfsidmap libnfsidmap +libnl libnl3 +libnl3 libnl3 +libpath_utils ding-libs +libpcap libpcap +libproxy libproxy +libpwquality libpwquality +librados2 ceph +librbd1 ceph +libref_array ding-libs +librepo librepo +libreport-filesystem libreport +librgw2 ceph +libseccomp libseccomp +libselinux libselinux +libselinux-python libselinux +libselinux-utils libselinux +libsemanage libsemanage +libsemanage-python libsemanage +libsepol libsepol +libsmbclient samba +libsolv libsolv +libsoup libsoup +libss e2fsprogs +libssh2 libssh2 +libsss_autofs sssd +libsss_idmap sssd +libsss_nss_idmap sssd +libsss_sudo sssd +libstdc++ gcc +libtalloc libtalloc +libtasn1 libtasn1 +libtdb libtdb +libtevent libtevent +libtirpc libtirpc +libunistring libunistring +libunwind libunwind +libuser libuser +libutempter libutempter +libuuid util-linux +libverto libverto +libverto-tevent libverto +libwbclient samba +libxml2 libxml2 +libxml2-python libxml2 +libyaml libyaml +linux-firmware linux-firmware +logrotate logrotate +lttng-ust lttng-ust +lua lua +lvm2 lvm2 +lvm2-libs lvm2 +lzo lzo +m2crypto m2crypto +make make +mdadm mdadm +mokutil mokutil +mozjs17 mozjs17 +nano nano +ncurses ncurses +ncurses-base ncurses +ncurses-libs ncurses +nettle nettle +net-tools net-tools +NetworkManager NetworkManager +NetworkManager-libnm NetworkManager +newt newt +newt-python newt +nfs-utils nfs-utils +nmap-ncat nmap +nspr nspr +nss nss +nss-altfiles nss-altfiles +nss-softokn nss-softokn +nss-softokn-freebl nss-softokn +nss-sysinit nss +nss-tools nss +nss-util nss-util +numactl-libs numactl +oci-register-machine oci-register-machine +oci-systemd-hook oci-systemd-hook +openldap openldap +openssh openssh +openssh-clients openssh +openssh-server openssh +openssl openssl +openssl-libs openssl +os-prober os-prober +ostree ostree +ostree-grub2 ostree +p11-kit p11-kit +p11-kit-trust p11-kit +pam pam +passwd passwd +pciutils-libs pciutils +pcre pcre +pinentry pinentry +pkgconfig pkgconfig +policycoreutils policycoreutils +policycoreutils-python policycoreutils +polkit polkit +polkit-pkla-compat polkit-pkla-compat +popt popt +ppp ppp +procps-ng procps-ng +protobuf-c protobuf-c +pth pth +pygobject3-base python-gobject-base +pygpgme pygpgme +pyliblzma pyliblzma +python python +python-backports python-backports +python-backports-ssl_match_hostname python-backports-ssl_match_hostname +python-cephfs ceph +python-chardet python-chardet +python-configobj python3-configobj +python-dateutil python3-dateutil +python-decorator python3-decorator +python-dmidecode python-dmidecode +python-docker-py python-docker-py +python-docker-pycreds python3-docker-pycreds +python-ethtool python-ethtool +python-iniparse python3-iniparse +python-ipaddress python-ipaddress +python-IPy python-IPy +python-jsonpatch python-jsonpatch +python-jsonpointer python-jsonpointer +python-libs python +python-perf kernel +python-prettytable python-prettytable +python-pycurl python-pycurl +python-pyudev python3-pyudev +python-rados ceph +python-rbd ceph +python-requests python-requests +python-rhsm python-rhsm +python-rhsm-certificates python-rhsm +python-setuptools python3-setuptools +python-six python-six +python-slip python-slip +python-slip-dbus python-slip +python-sssdconfig python3-sssdconfig +python-urlgrabber python-urlgrabber +python-urllib3 python-urllib3 +python-websocket-client python-websocket-client +pyxattr pyxattr +PyYAML PyYAML +qrencode-libs qrencode +quota quota +quota-nls quota +readline readline +rpcbind rpcbind +rpm rpm +rpm-build-libs rpm +rpm-libs rpm +rpm-python rpm +rsync rsync +runc runc +samba-client-libs samba +samba-common samba +sed sed +selinux-policy selinux-policy +selinux-policy-targeted selinux-policy +setools-console setools +setools-libs setools +setup setup +sg3_utils sg3_utils +sg3_utils-libs sg3_utils +shadow-utils shadow-utils +shared-mime-info shared-mime-info +shim shim-signed +skopeo skopeo +skopeo-containers skopeo +slang slang +snappy snappy +socat socat +sqlite sqlite +sssd sssd +sssd-ad sssd +sssd-client sssd +sssd-common sssd +sssd-common-pac sssd +sssd-ipa sssd +sssd-krb5 sssd +sssd-krb5-common sssd +sssd-ldap sssd +sssd-proxy sssd +subscription-manager subscription-manager +subscription-manager-plugin-container subscription-manager +subscription-manager-plugin-ostree subscription-manager +sudo sudo +systemd systemd +systemd-libs systemd +systemd-sysv systemd +tar tar +tcp_wrappers tcp_wrappers +tcp_wrappers-libs tcp_wrappers +tmux tmux +trousers trousers +tuned tuned +tuned-profiles-atomic tuned +tzdata tzdata +usermode usermode +userspace-rcu userspace-rcu +ustr ustr +util-linux util-linux +vim-minimal vim +virt-what virt-what +which which +wpa_supplicant wpa_supplicant +xfsprogs xfsprogs +xz xz +xz-libs xz +yajl yajl +yum yum +yum-metadata-parser yum-metadata-parser +zlib zlib diff --git a/sources b/sources new file mode 100644 index 0000000..e69de29