Skip to content

Commit

Permalink
feat: Packaging mrf dkms as a deb package
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielfedel committed Feb 21, 2024
1 parent 67ba9e5 commit cbd5988
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mrmShared/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,15 @@ To create an installable dksm package for this kernel module do the following:
1. Edit dkms/CONFIG to specify the group name for the target user
2. Run make in the dkms directory
3. Install the generated .rpm on your target system

# debian

On this folder runs:

dpkg-buildpackage

or

dpkg-buildpackage -b -uc -us # Not signing the package

A .deb package will be gerated one folder above.
5 changes: 5 additions & 0 deletions mrmShared/linux/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mrf-dkms (3-0) unstable; urgency=medium

* Initial package

-- Gabriel Fedel <[email protected]> Thu, 15 Feb 2024 13:12:59 +0100
1 change: 1 addition & 0 deletions mrmShared/linux/debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
13 changes: 13 additions & 0 deletions mrmShared/linux/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Source: mrf-dkms
Section: devel
Priority: extra
Maintainer: Gabriel Fedel <[email protected]>
Build-Depends: debhelper (>= 9),dkms

Package: mrf-dkms
Architecture: all
Depends: ${misc:Depends},
Description: Kernel driver for MRF timing cards.
Installs the kernel driver for interfacing to the
Micro Research Finland (MRF) timing cards over PCI/PCIe.
The driver is installed using dkms.
86 changes: 86 additions & 0 deletions mrmShared/linux/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@

It was downloaded from https://github.com/epics-modules/mrfioc2

Upstream Authors:

Michael Davidsaver <[email protected]>
Jerzy Jamroz <[email protected]>
Jure Krasna <[email protected]>
Hinko Kocevar <[email protected]>
Michael Abbott <[email protected]>
Dirk Zimoch <[email protected]>
Tom Slejko <[email protected]>
Jeong Han Lee <[email protected]>

Copyright:

Copyright (c) 2015 Brookhaven Science Associates as operator of
Brookhaven National Lab
Copyright (c) 2016 Michael Davidsaver

License:

mrfioc2 is distributed subject to the following license conditions:
SOFTWARE LICENSE AGREEMENT
Software: mrfioc2

1. The "Software", below, refers to mrfioc2 (in either source code, or
binary form and accompanying documentation). Each licensee is addressed
as "you" or "Licensee."

2. The copyright holders shown above and their third-party licensors hereby
grant Licensee a royalty-free nonexclusive license, subject to the
limitations stated herein and U.S. Government license rights.

3. You may modify and make a copy or copies of the Software for use within
your organization, if you meet the following conditions:
1. Copies in source code must include the copyright notice and this
Software License Agreement.
2. Copies in binary form must include the copyright notice and this
Software License Agreement in the documentation and/or other
materials provided with the copy.

4. You may modify a copy or copies of the Software or any portion of it, thus
forming a work based on the Software, and distribute copies of such work
outside your organization, if you meet all of the following conditions:
1. Copies in source code must include the copyright notice and this
Software License Agreement;
2. Copies in binary form must include the copyright notice and this
Software License Agreement in the documentation and/or other
materials provided with the copy;
3. Modified copies and works based on the Software must carry
prominent notices stating that you changed specified portions of
the Software.

5. Portions of the Software resulted from work developed under a
U.S. Government contract and are subject to the following license:
the Government is granted for itself and others acting on its behalf a
paid-up, nonexclusive, irrevocable worldwide license in this computer
software to reproduce, prepare derivative works, and perform publicly and
display publicly.

6. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF
ANY KIND. THE COPYRIGHT HOLDERS, THEIR THIRD PARTY LICENSORS, THE UNITED
STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1)
DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY
OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE
SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT
INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL
FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE
CORRECTED.

7. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT HOLDERS, THEIR
THIRD PARTY LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF
ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE,
INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY
REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF
CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE,
EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE POSSIBILITY OF SUCH
LOSS OR DAMAGES.


The Debian packaging is (C) 2023, Gabriel Fedel <[email protected]> and
is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
6 changes: 6 additions & 0 deletions mrmShared/linux/debian/mrf-dkms.dkms
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PACKAGE_NAME="mrf"
PACKAGE_VERSION="#MODULE_VERSION#"
BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
DEST_MODULE_LOCATION[0]="/updates/dkms/"
AUTOINSTALL="yes"
REMAKE_INITRD=NO
2 changes: 2 additions & 0 deletions mrmShared/linux/debian/mrf-dkms.udev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# UDEV rule giving access to MRF device
KERNEL=="uio*", ATTR{name}=="mrf-pci", GROUP="mrf", MODE="0660"
28 changes: 28 additions & 0 deletions mrmShared/linux/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/make -f

export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk

%:
dh $@ --with dkms

override_dh_install:
dh_install *.c usr/src/mrf-$(DEB_VERSION_UPSTREAM)/
dh_install *.h usr/src/mrf-$(DEB_VERSION_UPSTREAM)/
dh_install K* usr/src/mrf-$(DEB_VERSION_UPSTREAM)/
dh_install Makefile usr/src/mrf-$(DEB_VERSION_UPSTREAM)/
dh_install patchize.sh usr/src/mrf-$(DEB_VERSION_UPSTREAM)/
dh_install README.md usr/src/mrf-$(DEB_VERSION_UPSTREAM)/
dh_install debian/mrf-dkms.udev usr/src/mrf-$(DEB_VERSION_UPSTREAM)/50-mrf.rules

override_dh_dkms:
dh_dkms -V $(DEB_VERSION_UPSTREAM)

override_dh_auto_configure:
override_dh_auto_build:
override_dh_auto_test:
override_dh_auto_install:
override_dh_auto_clean:
override_dh_installudev:
dh_installudev --priority=50

0 comments on commit cbd5988

Please sign in to comment.