From c54bde733f21afeab9fbc3ea17f355489767bb83 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 07 Jan 2021 03:37:07 -0500 Subject: Initial commit --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46688c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# Vim swap and other dot files +.* +!.gitignore + +# Source archives +*-*.orig.tar.* + +# Work area +tmp/ diff --git a/build b/build new file mode 100755 index 0000000..c7e1b98 --- /dev/null +++ b/build @@ -0,0 +1,25 @@ +#!/usr/bin/make -f + +include ../source.mk + +ARGS = \ + PREFIX=/usr \ + LIBDIR=/usr/lib/$(OPK_HOST_ARCH) \ + MANDIR=/usr/share/man \ + BUILD_STATIC_LIB=0 + +nop: + @: + +build: + oh-autobuild -- $(ARGS) + touch $@ + +install: build + oh-autoinstall -- $(ARGS) + # Perl script: + rm dest/usr/sbin/sensors-detect + oh-fixperms + oh-strip + oh-installfiles + oh-shlibdeps diff --git a/changelog b/changelog new file mode 100644 index 0000000..7b33459 --- /dev/null +++ b/changelog @@ -0,0 +1,5 @@ +lm-sensors (3.6.0-1) trunk + + * Initial release. + + -- Patrick McDermott Thu, 07 Jan 2021 03:25:23 -0500 diff --git a/control b/control new file mode 100644 index 0000000..5f0bc9a --- /dev/null +++ b/control @@ -0,0 +1,9 @@ +Maintainer: Patrick McDermott +Build-Depends: + opkbuild (>= 4.2.1), + opkhelper-3.0 (>= 3.1.3), + busybox (>= 1.32.0-1), + bison, + flex (>= 2.5.1), + libc-bin [any-any-glibc], +Homepage: https://hwmon.wiki.kernel.org/lm_sensors diff --git a/extract-copyright-comments b/extract-copyright-comments new file mode 100755 index 0000000..9cbf6bf --- /dev/null +++ b/extract-copyright-comments @@ -0,0 +1,216 @@ +#!/bin/sh +# +# Extract comments containing copyright notices from C/C++ files +# +# Copyright (C) 2020 Patrick McDermott +# +# This program 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 3 of the License, or +# (at your option) any later version. +# +# This program 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 . + +set -eu + +LF=' +' +HT=' ' + +bufc= +bufi= +c= + +getc() +{ + if [ ${bufi} -ge ${bufc} ]; then + c='' + else + eval "c=\${bufv_${bufi}}" + bufi=$((${bufi} + 1)) + fi +} + +extract_cxx_comment() +{ + local indent="${1}" + shift 1 + local comment='//' + + while :; do + getc + case "${c}" in + "${LF}") + break + ;; + '') + printf '\tError: Unterminated C++ comment\n' \ + 1>&2 + return 1 + ;; + *) + comment="${comment}${c}" + ;; + esac + done + + if printf '%s' "${comment}" | grep -Eqi \ + 'copyright|\(c\)|license|public domain' + then + printf '\t%s\n' "${indent}${comment}" + fi + + return 0 +} + +extract_c_comment() +{ + local indent="${1}" + shift 1 + local comment='/*' + local asterisk=false + + while :; do + getc + case "${c}" in + '*') + asterisk=true + comment="${comment}${c}" + ;; + '/') + comment="${comment}${c}" + if ${asterisk}; then + break + fi + ;; + '') + printf '\tError: Unterminated C comment\n' 1>&2 + return 1 + ;; + *) + asterisk=false + comment="${comment}${c}" + ;; + esac + done + + if printf '%s' "${comment}" | grep -Eqi \ + 'copyright|\(c\)|license|public domain' + then + printf '%s\n' "${indent}${comment}" | sed 's/^/\t/' + fi + + return 0 +} + +extract() +{ + local fn="${1}" + shift 1 + local newline=true + local indent='' + local quote= + + printf '%s\n' "${fn}" + + # Read file into array + eval "$(awk -v FS='' -v j=0 -v squote="'" -v esc_squote="'\\\\''" ' + { + for (i = 1; i <= NF; ++i) { + sub(squote, esc_squote, $i); + printf("bufv_%d=" squote "%s" squote "\n", + j++, $i); + }; + printf("bufv_%d=" squote "\n" squote "\n", j++); + } + END { + printf("bufc=%d", j); + } + ')" + bufi=0 + + while :; do + getc + case "${c}" in + '/') + newline=false + getc + case "${c}" in + '/') + extract_cxx_comment "${indent}"\ + || return 1 + ;; + '*') + extract_c_comment "${indent}" \ + || return 1 + ;; + esac + ;; + "${LF}") + newline=true + indent='' + ;; + "${HT}" | ' ') + if ${newline}; then + indent="${indent}${c}" + fi + ;; + "'" | '"') + newline=false + quote="${c}" + while :; do + getc + case "${c}" in + "${quote}") + break + ;; + \\) + # This doesn't + # explicitly handle + # octal, hexadecimal, or + # Unicode sequences; but + # it's good enough to + # handle escaped quotes. + getc + ;; + esac + done + ;; + '') + break + ;; + *) + newline=false + ;; + esac + done + + return 0 +} + +main() +{ + local f= + + if [ ${#} -eq 0 ]; then + extract 'INPUT' || return 1 + else + for f in "${@}"; do + if [ x"${f}" = x'-' ]; then + extract 'INPUT' || return 1 + else + extract "${f}" 0<"${f}" || return 1 + fi + done + fi + + return 0 +} + +main "${@}" diff --git a/format b/format new file mode 100644 index 0000000..cd5ac03 --- /dev/null +++ b/format @@ -0,0 +1 @@ +2.0 diff --git a/release b/release new file mode 100755 index 0000000..871cb4a --- /dev/null +++ b/release @@ -0,0 +1,13 @@ +#!/bin/sh + +set -eu + +read src ver <<-EOF + $(sed '1s/^\(.*\) (\(.*\)) .*$/\1 \2/; q;' changelog) + EOF + +sed '/^ -- .* /{ s/^\( -- .* \).*$/\1'"$(LC_ALL='POSIX' date \ + '+%a, %d %b %Y %H:%M:%S %z')"'/; :l; n; b l; };' changelog >changelog~ +mv changelog~ changelog +git commit -m "changelog: Release ${src} ${ver}" -- changelog +git tag "${src}/${ver}" HEAD diff --git a/source.mk b/source.mk new file mode 100644 index 0000000..ed694e3 --- /dev/null +++ b/source.mk @@ -0,0 +1,10 @@ +upstream_version = $$(printf '%s' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \ + sed 's/\./-/g') +upstream_url_base = https://github.com/lm-sensors/lm-sensors +upstream_url = $(upstream_url_base)/archive/V$(upstream_version).tar.gz +source_archive = ../$(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.gz + +$(source_archive): + wget -O '$@' "$(upstream_url)" + +source: $(source_archive) -- cgit v0.9.1