Packaging files removed.

This commit is contained in:
CyrIng
2018-11-22 01:05:53 +01:00
parent d106c6ed42
commit 1164e0898b
17 changed files with 15 additions and 316 deletions

View File

@@ -9,7 +9,7 @@ KVERSION = $(shell uname -r)
ifeq ($(CONFDIR),)
export CONFDIR = $(CURDIR)
include $(CONFDIR)/package/dkms.conf
include $(CONFDIR)/dkms.conf
endif
BINDIR = $(DESTDIR)/bin
@@ -67,16 +67,12 @@ ccflags-y += -D MSR_CORE_PERF_UCC=$(MSR_CORE_PERF_UCC)
ccflags-y += -D MSR_CORE_PERF_URC=$(MSR_CORE_PERF_URC)
all: corefreqd corefreq-cli
ifneq ($(wildcard /lib/modules/$(KVERSION)/build/.),)
$(MAKE) -j1 -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
endif
.PHONY: clean
clean:
rm -f corefreqd corefreq-cli
ifneq ($(wildcard /lib/modules/$(KVERSION)/build/.),)
$(MAKE) -j1 -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
endif
.PHONY: install
install: all
@@ -97,9 +93,8 @@ endif
dkms_install:
ifeq ($(UID), 0)
install -Dm 0644 Makefile $(DRVSRC)/Makefile
install -Dm 0644 package/dkms.conf $(DRVSRC)/package/dkms.conf
ln -rs $(DRVSRC)/package/dkms.conf $(DRVSRC)/dkms.conf
install -Dm 0755 package/scripter.sh $(DRVSRC)/package/scripter.sh
install -Dm 0644 dkms.conf $(DRVSRC)/dkms.conf
install -Dm 0755 scripter.sh $(DRVSRC)/scripter.sh
install -m 0644 *.c *.h $(DRVSRC)/
endif
@@ -110,13 +105,15 @@ ifeq ($(DKMS), 0)
dkms add -c $(DRVSRC)/dkms.conf -m corefreqk -v $(DRV_VERSION)
dkms build -c $(DRVSRC)/dkms.conf corefreqk/$(DRV_VERSION)
dkms install -c $(DRVSRC)/dkms.conf corefreqk/$(DRV_VERSION)
else
$(error DKMS not found)
endif
endif
.PHONY: service_install
service_install:
ifeq ($(UID), 0)
install -Dm 0644 package/corefreqd.service \
install -Dm 0644 corefreqd.service \
$(DESTDIR)/usr/lib/systemd/system/corefreqd.service
endif
@@ -133,6 +130,8 @@ ifeq ($(UID), 0)
ifeq ($(DKMS), 0)
dkms remove -c $(DRVSRC)/dkms.conf corefreqk/$(DRV_VERSION) --all
rm -Ir $(DRVSRC)
else
$(error DKMS not found)
endif
endif

View File

@@ -144,29 +144,20 @@ CPU IPS IPC CPI
[corefreq-git](https://aur.archlinux.org/packages/corefreq-git) can be installed from the Arch User Repository.
## Debian, Ubuntu
* Install from the Launchpad repository.
:hash:`add-apt-repository ppa:cyring/corefreq`
:hash:`apt update`
:hash:`apt install corefreq`
* For a manual setup, install those prerequisites.
* Install those prerequisites then proceed with the DKMS or manual setup.
:hash:`apt-get install dkms git libpthread-stubs0-dev`
## Red Hat, CentOS
* For the CoreFreq rpm package, install the following packages.
* Install the following packages then proceed with the DKMS or manual setup.
:hash:`yum install epel-release`
:hash:`yum install dkms`
:hash:`yum install kernel-devel`
:hash:`yum group install "Development Tools"`
:hash:`yum install corefreq-{version}.x86_64.rpm`
## No Distribution
* The Makefile provides setup scripts.
### Systemd & DKMS compatible
## DKMS & Systemd setup
* All-in-one installation.
:heavy_dollar_sign:`git clone https://github.com/cyring/CoreFreq.git`
:heavy_dollar_sign:`cd CoreFreq`
:heavy_dollar_sign:`make`
:hash:`make dkms_install`
:hash:`make dkms_setup`
:hash:`make service_install`
@@ -174,14 +165,14 @@ CPU IPS IPC CPI
:hash:`modprobe corefreqk`
:hash:`systemctl start corefreqd`
:heavy_dollar_sign:`corefreq-cli`
* Uninstallation scripts.
* Uninstallation.
_( a prompt will ask you to confirm the deletion of the CoreFreq source tree )_
:hash:`systemctl stop corefreqd`
:hash:`modprobe -r corefreqk`
:hash:`cd /usr/src/corefreqk-{version}`
:hash:`make dkms_uninstall`
### Manual setup
## Manual setup
* Build then install the kernel module, the daemon and the client.
:heavy_dollar_sign:`make`
:hash:`make install`

View File

@@ -5,7 +5,7 @@
AUTOINSTALL="yes"
REMAKE_INITRD="no"
DRV_PATH=/kernel/drivers/misc
DRV_VERSION=1.37
DRV_VERSION=1.38
PACKAGE_NAME="corefreqk"
PACKAGE_VERSION="$DRV_VERSION"
BUILT_MODULE_NAME[0]="corefreqk"
@@ -15,7 +15,7 @@ MAKE[0]="make -C $source_tree/$PACKAGE_NAME-$PACKAGE_VERSION"
#
DAEMON="\$source_tree/\$PACKAGE_NAME-\$PACKAGE_VERSION/corefreqd"
CLIENT="\$source_tree/\$PACKAGE_NAME-\$PACKAGE_VERSION/corefreq-cli"
SCRIPT="package/scripter.sh"
SCRIPT="scripter.sh"
COMMAND="install -Dm 0755 -s -t /bin"
OBJECTS="\$source_tree/\$PACKAGE_NAME-\$PACKAGE_VERSION/*.o"
BINARIES="/bin/corefreqd /bin/corefreq-cli"

View File

@@ -1,26 +0,0 @@
# Maintainer: CyrIng <labs[at]cyring[dot]fr>
# Contributor: CyrIng <labs[at]cyring[dot]fr>
_gitname=CoreFreq
pkgname=corefreq-git
realname=corefreq
pkgver=1.37
pkgrel=0.3
pkgdesc="CoreFreq, a processor monitoring software with a kernel module inside."
arch=('x86_64')
url='https://github.com/cyring/CoreFreq'
license=('GPL2')
depends=('dkms')
makedepends=('git' 'sed')
source=(git+${url}.git)
md5sums=('SKIP')
install=${realname}.install
package() {
cd ${srcdir}/${_gitname}
make DESTDIR=${pkgdir} dkms_install service_install
}
pkgver() {
cd "${srcdir}/${_gitname}"
echo "$(sed -nE 's/#define\s+COREFREQ_VERSION\s+"([0-9\.]+)"/\1/p' coretypes.h).r$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)"
}

View File

@@ -1,38 +0,0 @@
MODULE="corefreqk"
post_install() {
A_B_C_D=${1}
DRV_VERSION=${A_B_C_D%-*}
dkms add -q -m ${MODULE} -v ${DRV_VERSION}
dkms build -q ${MODULE}/${DRV_VERSION}
dkms install -q ${MODULE}/${DRV_VERSION}
echo -e '\n[ \033[1;36;40mCoreFreq\033[0m Starting Instructions\033[0m ]\n'\
'\n1: load the kernel module\n'\
' # \033[1;36;40mmodprobe corefreqk\033[0m\n'\
'\n2: start the daemon\n'\
' # \033[1;36;40msystemctl start corefreqd\033[0m\n'\
'\n3: run the client\n'\
' $ \033[1;36;40mcorefreq-cli\033[0m\n'
}
pre_upgrade() {
pre_remove ${2%%-*}
}
post_upgrade() {
post_install ${1%%-*}
}
pre_remove() {
if [ "$(dkms status -m ${MODULE})" ]; then
modprobe -r ${MODULE} 2>/dev/null
if [ $? -eq 0 ]; then
echo "Module [${MODULE}] unloaded.\n"
fi
A_B_C_D=${1}
DRV_VERSION=${A_B_C_D%-*}
dkms remove -q ${MODULE}/${DRV_VERSION} --all
fi
}

View File

@@ -1,5 +0,0 @@
corefreq (1.37.0.14-0ubuntu1) bionic; urgency=low
* Fix the postinst and prerm condition.
-- CyrIng <labs@cyring.fr> Mon, 05 Nov 2018 06:06:06 +0100

View File

@@ -1 +0,0 @@
9

View File

@@ -1,19 +0,0 @@
Source: corefreq
Section: utils
Priority: optional
Maintainer: Planet Ubuntu <rt@ubuntu.com>
Build-Depends: debhelper (>= 9)
Standards-Version: 4.1.2
Package: corefreq
Architecture: amd64
XSBC-Original-Maintainer: CyrIng <labs@cyring.fr>
Homepage: https://github.com/cyring/CoreFreq
#Vcs-Git: https://anonscm.debian.org/git/collab-maint/corefreq.git
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/corefreq.git
Depends: ${shlibs:Depends}, ${misc:Depends}, dkms
Description: CPU monitoring
CoreFreq is a CPU monitoring software designed for the 64-bits Processors,
including architectures Intel Atom, Core2, Xeon, Phi, Nehalem, Westmere,
SandyBridge, IvyBridge, Haswell, Broadwell, Skylake, Kaby Lake, Coffee Lake,
AMD K8, Zen

View File

@@ -1,26 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: corefreq
Source: <https://github.com/cyring/CoreFreq>
Files: *
Copyright: 2015-2018 CYRIL INGENIERIE <labs@cyring.fr>
License: GPL-2+
Files: debian/*
Copyright: 2018 CYRIL INGENIERIE <labs@cyring.fr>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

View File

@@ -1 +0,0 @@
corefreq_1.37.0.12-0ubuntu1_source.buildinfo utils optional

View File

@@ -1,36 +0,0 @@
#!/bin/sh
#
# CoreFreq
# Copyright (C) 2015-2018 CYRIL INGENIERIE
# Licenses: GPL2
#
set -e
case "$1" in
configure)
PACKAGE="corefreq"
MODULE="corefreqk"
A_B_C_D=$(dpkg-query --show --showformat='${Version}' $PACKAGE 2>/dev/null)
if [ -n "$A_B_C_D" ]; then
A_B_C=${A_B_C_D%.*}
VERSION=${A_B_C%.*}
dkms install $MODULE/$VERSION
else
echo "Post Installation: Can not query [${PACKAGE}]\n" >&2
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst: unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

View File

@@ -1,42 +0,0 @@
#!/bin/sh
#
# CoreFreq
# Copyright (C) 2015-2018 CYRIL INGENIERIE
# Licenses: GPL2
#
set -e
case "$1" in
remove|upgrade|deconfigure)
PACKAGE="corefreq"
MODULE="corefreqk"
A_B_C_D=$(dpkg-query --show --showformat='${Version}' $PACKAGE 2>/dev/null)
if [ -n "$A_B_C_D" ]; then
A_B_C=${A_B_C_D%.*}
VERSION=${A_B_C%.*}
if [ "$(dkms status -m $MODULE)" ]; then
modprobe -r $MODULE 2>/dev/null
if [ $? -eq 0 ]; then
echo "Module [${MODULE}] unloaded.\n"
fi
dkms remove $MODULE/$VERSION --all
fi
else
echo "Pre Removal: Can not query [${PACKAGE}]\n" >&2
fi
;;
failed-upgrade)
;;
*)
echo "prerm: unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

View File

@@ -1,9 +0,0 @@
#!/usr/bin/make -f
export DH_VERBOSE = 1
%:
dh $@
install:
$(MAKE) DESTDIR=$(CURDIR)/debian/corefreq install
$(MAKE) DESTDIR=$(CURDIR)/debian/corefreq dkms_install

View File

@@ -1 +0,0 @@
3.0 (quilt)

View File

@@ -1,87 +0,0 @@
%define MODULE corefreqk
%define SERVICE corefreqd.service
Summary: CoreFreq
Name: corefreq
Version: 1.37
Release: 0.1
License: GPL2
URL: https://github.com/cyring/CoreFreq
Group: System
Packager: CyrIng
Requires: dkms
BuildRequires: dkms
ExclusiveArch: x86_64
%description
CoreFreq is a CPU monitoring software designed for the 64-bits Processors,
including architectures Intel Atom, Core2, Xeon, Phi, Nehalem, Westmere,
SandyBridge, IvyBridge, Haswell, Broadwell, Skylake, Kaby Lake, Coffee Lake,
AMD K8, Zen
%prep
rm -fr %{name}-%{version}
git clone %{url}.git %{name}-%{version} && rm -fr %{name}-%{version}/.git
%install
install -Dm 0644 %{name}-%{version}/package/dkms.conf \
${RPM_BUILD_ROOT}%{_prefix}/src/%{MODULE}-%{version}/package/dkms.conf
ln -sr ${RPM_BUILD_ROOT}%{_prefix}/src/%{MODULE}-%{version}/package/dkms.conf \
${RPM_BUILD_ROOT}%{_prefix}/src/%{MODULE}-%{version}/dkms.conf
install -Dm 0755 %{name}-%{version}/package/scripter.sh \
${RPM_BUILD_ROOT}%{_prefix}/src/%{MODULE}-%{version}/package/scripter.sh
install -Dm 0644 %{name}-%{version}/Makefile \
${RPM_BUILD_ROOT}%{_prefix}/src/%{MODULE}-%{version}/Makefile
install -m 0644 %{name}-%{version}/*.c %{name}-%{version}/*.h \
${RPM_BUILD_ROOT}%{_prefix}/src/%{MODULE}-%{version}/
install -Dm 0644 %{name}-%{version}/package/%{SERVICE} \
${RPM_BUILD_ROOT}%{_prefix}/lib/systemd/system/%{SERVICE}
%clean
if [ "${RPM_BUILD_ROOT}" != "/" ]; then
rm -rf ${RPM_BUILD_ROOT}
fi
%files
%defattr(-,root,root)
%attr(0755,root,root) %dir %{_prefix}/src/%{MODULE}-%{version}
%attr(0755,root,root) %dir %{_prefix}/src/%{MODULE}-%{version}/package
%attr(0644,root,root) %{_prefix}/src/%{MODULE}-%{version}/package/dkms.conf
%attr(-,root,root) %{_prefix}/src/%{MODULE}-%{version}/dkms.conf
%attr(0755,root,root) %{_prefix}/src/%{MODULE}-%{version}/package/scripter.sh
%attr(0644,root,root) %{_prefix}/src/%{MODULE}-%{version}/Makefile
%attr(0644,root,root) %{_prefix}/src/%{MODULE}-%{version}/*.c
%attr(0644,root,root) %{_prefix}/src/%{MODULE}-%{version}/*.h
%attr(0644,root,root) %{_prefix}/lib/systemd/system/%{SERVICE}
%post
dkms add -q -m %{MODULE} -v %{version} --rpm_safe_upgrade \
&& dkms build -q %{MODULE}/%{version} \
&& dkms install -q %{MODULE}/%{version} \
&& echo -e '\n[ \033[1;36;40mCoreFreq\033[0m Starting Instructions\033[0m ]\n'\
'\n1: load the kernel module\n'\
' # \033[1;36;40mmodprobe corefreqk\033[0m\n'\
'\n2: start the daemon\n'\
' # \033[1;36;40msystemctl start corefreqd\033[0m\n'\
'\n3: run the client\n'\
' $ \033[1;36;40mcorefreq-cli\033[0m\n'
exit $?
%preun
systemctl status %{SERVICE} 1>/dev/null 2>&1
if [ $? -eq 0 ]; then
systemctl stop %{SERVICE} \
|| systemctl disable %{SERVICE} \
&& echo "Service [%{SERVICE}] uninstalled."
fi
lsmod 2>/dev/null | grep %{MODULE} 1>/dev/null 2>&1
if [ $? -eq 0 ]; then
modprobe -r %{MODULE} 2>/dev/null \
&& echo "Module [%{MODULE}] unloaded."
fi
dkms remove -q %{MODULE}/%{version} --all --rpm_safe_upgrade
exit $?
%changelog
* Fri Nov 9 2018 CyrIng <labs@cyring.fr>
- Initial RPM release