Added README

- Renamed dkms to mach
- Copied a few missing pieces from debian build
- Added override mechanism for OS

Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
This commit is contained in:
Andy Neff 2018-01-23 12:19:46 -05:00
parent 0e58836f09
commit 0097a23dd9
3 changed files with 30 additions and 9 deletions

18
rpm/README.md Normal file
View File

@ -0,0 +1,18 @@
# Building RPMs
1. Install `docker` and `docker-compose`
2. `cd rpm`
3. `docker-compose run rpm`
4. Now you can run `dnf install RPMS/x84_64/darling*.rpm`
5. `setsebool -P mmap_low_allowed 1` to allow darling low level access and run
## Building on other operating systems
By default, it will build for Fedora 27. To use a different OS, simply
RPM_OS=fedora:26
## Future improvements
- Everything is based off of dnf. Supporting zypper and yum will reach others
- Because of the way the submodules are handled, this isn't quite ready for releasing but this can be solved using [%autosetup in the %prep to checkout the submodules.](https://fedoraproject.org/wiki/Packaging:SourceURL#Git_Submodules)

View File

@ -30,22 +30,22 @@ AutoReqProv: no
%description
Darling macOS emulator
%package dkms
%package mach
Summary: Darling mach dkms module
Group: Utility
Requires: dkms make gcc kernel-devel
AutoReqProv: no
%description dkms
Linux kernel module for darling
%description mach
Linux kernel module for darling-mach
%prep
%setup -q -n %{name}
%build
mkdir -p build
%{__mkdir_p} build
pushd build
# Release is broken! https://github.com/darlinghq/darling/issues/331
# Release is broken https://github.com/darlinghq/darling/issues/331
# -DCMAKE_BUILD_TYPE=Release \
%{__cmake} -DCMAKE_INSTALL_PREFIX=/usr \
..
@ -56,6 +56,7 @@ popd
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
pushd build
%{make_install}
%{make_build} lkm_generate
popd
%{__install} -d -m 755 %{?buildroot}/usr/src/%{name}-mach-%{version}/miggen
cp -dr --no-preserve=ownership src/lkm %{?buildroot}/usr/src/%{name}-mach-%{version}/lkm
@ -68,14 +69,14 @@ setcap cap_sys_rawio=ep %{_libexecdir}/darling/bin/mldr32
#setsebool -P mmap_low_allowed 1
%preun dkms
%preun mach
/usr/sbin/dkms remove -m %{name}-mach -v %{version} --all
%post dkms
%post mach
occurrences=$(/usr/sbin/dkms status | grep "%{name}" | grep "%{version}" | wc -l)
if [ ! ${occurrences} -gt 0 ];
then
/usr/sbin/dkms add -m %{name}-mach -v %{version}
/usr/sbin/dkms add -m %{name}-mach -v %{version}
fi
/usr/sbin/dkms build -m %{name}-mach -v %{version}
/usr/sbin/dkms install -m %{name}-mach -v %{version}
@ -85,7 +86,7 @@ fi
%{_bindir}/darling
%{_libexecdir}/darling
%files dkms
%files mach
%{_sysconfdir}/udev/rules.d/00-darling-mach.rules
%{_prefix}/src/%{name}-mach-%{version}

View File

@ -4,6 +4,8 @@ services:
rpm:
build:
context: .
args:
- OS=${RPM_OS-fedora:27}
volumes:
- ..:/src:ro
- ./RPMS:/root/rpmbuild/RPMS