Skip to content

Commit

Permalink
Change source for utilities/watch, gain UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
Mno-hime authored and pyhalov committed Feb 20, 2019
1 parent 8624447 commit 4ab7712
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 80 deletions.
47 changes: 23 additions & 24 deletions components/sysutils/watch/Makefile
Expand Up @@ -9,46 +9,45 @@
#

#
# Copyright 2016 Adam Stevko<
# Copyright 2019 Michal Nowak
#

PREFERRED_BITS= 64

include ../../../make-rules/shared-macros.mk

COMPONENT_NAME= watch
COMPONENT_VERSION= 3.2.8
COMPONENT_VERSION= 3.3.15
COMPONENT_SUMMARY= The Linux watch utility
COMPONENT_PROJECT_URL= http://procps.sourceforge.net
COMPONENT_PROJECT_URL= https://gitlab.com/procps-ng/procps
COMPONENT_FMRI= utilities/watch
COMPONENT_CLASSIFICATION= Applications/System Utilities
COMPONENT_SRC= procps-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE= procps-$(COMPONENT_VERSION).tar.gz
COMPONENT_ARCHIVE_URL= http://procps.sourceforge.net/$(COMPONENT_ARCHIVE)
COMPONENT_ARCHIVE_HASH= sha256:11ed68d8a4433b91cd833deb714a3aa849c02aea738c42e6b4557982419c1535
COMPONENT_LICENSE= GPLv2
COMPONENT_LICENSE_FILE= COPYING
COMPONENT_SRC= procps-ng-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
COMPONENT_ARCHIVE_URL= http://downloads.sourceforge.net/project/procps-ng/Production/$(COMPONENT_ARCHIVE)
COMPONENT_ARCHIVE_HASH= sha256:10bd744ffcb3de2d591d2f6acf1a54a7ba070fdcc432a855931a5057149f0465
COMPONENT_LICENSE= GPL-2.0-or-later, LGPL-2.1-or-later
COMPONENT_LICENSE_FILE= COPYING

include $(WS_MAKE_RULES)/prep.mk
include $(WS_MAKE_RULES)/justmake.mk
include $(WS_MAKE_RULES)/configure.mk
include $(WS_MAKE_RULES)/ips.mk

COMPONENT_BUILD_TARGETS= watch

COMPONENT_BUILD_ENV+= CC="$(CC)"
COMPONENT_BUILD_ENV+= CFLAGS="$(CFLAGS)"

COMPONENT_INSTALL_ENV+= $(COMPONENT_BUILD_ENV)
COMPONENT_PREP_ACTION = (cd $(@D) ; autoreconf -f -i)

$(INSTALL_32): $(BUILD_32)
$(MKDIR) $(PROTOUSRBINDIR) $(PROTOUSRSHAREMAN1DIR)

$(INSTALL) $(BUILD_DIR_32)/watch $(PROTOUSRBINDIR)/watch
$(INSTALL) $(BUILD_DIR_32)/watch.1 $(PROTOUSRSHAREMAN1DIR)/watch.1
# Disable optional utilities
CONFIGURE_OPTIONS += --disable-pidof
CONFIGURE_OPTIONS += --disable-kill
CONFIGURE_OPTIONS += --disable-modern-top
CONFIGURE_OPTIONS += --disable-numa
CONFIGURE_OPTIONS += --enable-watch8bit

build: $(BUILD_32)
build: $(BUILD_64)

install: $(INSTALL_32)
install: $(INSTALL_64)

test: $(TEST_32)
test: $(TEST_64)

# Auto-generated dependencies
REQUIRED_PACKAGES += library/ncurses
REQUIRED_PACKAGES += system/library
39 changes: 38 additions & 1 deletion components/sysutils/watch/manifests/sample-manifest.p5m
Expand Up @@ -10,7 +10,7 @@
#

#
# Copyright 2016 <contributor>
# Copyright 2018 <contributor>
#

set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
Expand All @@ -23,4 +23,41 @@ set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'

file path=usr/bin/watch
file path=usr/include/proc/alloc.h
file path=usr/include/proc/devname.h
file path=usr/include/proc/escape.h
file path=usr/include/proc/numa.h
file path=usr/include/proc/procps.h
file path=usr/include/proc/pwcache.h
file path=usr/include/proc/readproc.h
file path=usr/include/proc/sig.h
file path=usr/include/proc/slab.h
file path=usr/include/proc/sysinfo.h
file path=usr/include/proc/version.h
file path=usr/include/proc/wchan.h
file path=usr/include/proc/whattime.h
file path=usr/lib/$(MACH64)/libprocps.a
link path=usr/lib/$(MACH64)/libprocps.so target=libprocps.so.7.1.0
link path=usr/lib/$(MACH64)/libprocps.so.7 target=libprocps.so.7.1.0
file path=usr/lib/$(MACH64)/libprocps.so.7.1.0
file path=usr/lib/$(MACH64)/pkgconfig/libprocps.pc
file path=usr/share/doc/procps-ng/FAQ
file path=usr/share/doc/procps-ng/bugs.md
file path=usr/share/locale/de/LC_MESSAGES/procps-ng.mo
file path=usr/share/locale/fr/LC_MESSAGES/procps-ng.mo
file path=usr/share/locale/pl/LC_MESSAGES/procps-ng.mo
file path=usr/share/locale/pt_BR/LC_MESSAGES/procps-ng.mo
file path=usr/share/locale/sv/LC_MESSAGES/procps-ng.mo
file path=usr/share/locale/uk/LC_MESSAGES/procps-ng.mo
file path=usr/share/locale/vi/LC_MESSAGES/procps-ng.mo
file path=usr/share/locale/zh_CN/LC_MESSAGES/procps-ng.mo
file path=usr/share/man/man1/ps.1
file path=usr/share/man/man1/pwdx.1
file path=usr/share/man/man1/slabtop.1
file path=usr/share/man/man1/tload.1
file path=usr/share/man/man1/watch.1
file path=usr/share/man/man3/openproc.3
file path=usr/share/man/man3/readproc.3
file path=usr/share/man/man3/readproctab.3
file path=usr/share/man/man5/sysctl.conf.5
file path=usr/share/man/man8/sysctl.8
97 changes: 97 additions & 0 deletions components/sysutils/watch/patches/01-disable-utilities.patch
@@ -0,0 +1,97 @@
Disable all utilities but watch.

--- procps-ng-3.3.15/Makefile.am.~1~ 2018-05-19 23:35:23.067591570 +0000
+++ procps-ng-3.3.15/Makefile.am 2019-02-16 15:13:07.738914886 +0000
@@ -30,24 +30,13 @@ transform =

if !CYGWIN
transform += s/pscommand/ps/; $(program_transform_name)
-sbin_PROGRAMS = \
- sysctl
+sbin_PROGRAMS =
else
transform += s/pscommand/procps/; $(program_transform_name)
endif

if !CYGWIN
-bin_PROGRAMS = \
- ps/pscommand \
- free \
- pgrep \
- pkill \
- pmap \
- pwdx \
- tload \
- uptime \
- vmstat \
- w
+bin_PROGRAMS =
else
usrbin_exec_PROGRAMS += \
ps/pscommand \
@@ -63,15 +52,7 @@ endif
lib_LTLIBRARIES = \
proc/libprocps.la

-dist_man_MANS = \
- free.1 \
- pgrep.1 \
- pkill.1 \
- pmap.1 \
- uptime.1 \
- vmstat.8 \
- w.1 \
- ps/procps.1
+dist_man_MANS =

if !CYGWIN
dist_man_MANS += \
@@ -133,9 +114,7 @@ endif
if WITH_NCURSES
if !CYGWIN
bin_PROGRAMS += \
- slabtop \
- watch \
- top/top
+ watch
else
usrbin_exec_PROGRAMS += \
watch \
@@ -143,8 +122,7 @@ usrbin_exec_PROGRAMS += \
endif

dist_man_MANS += \
- watch.1 \
- top/top.1
+ watch.1
watch_SOURCES = watch.c lib/strutils.c lib/fileutils.c
watch_LDADD = @WATCH_NCURSES_LIBS@ $(CYGWINFLAGS)
watch_CFLAGS = @WATCH_NCURSES_CFLAGS@
@@ -197,8 +175,7 @@ pwdx_SOURCES = pwdx.c lib/fileutils.c
pwdx_LDADD= $(CYGWINFLAGS)
sysctl_SOURCES = \
sysctl.c \
- lib/fileutils.c \
- procio.c
+ lib/fileutils.c
endif
tload_SOURCES = tload.c lib/strutils.c lib/fileutils.c
uptime_SOURCES = uptime.c lib/fileutils.c
@@ -224,8 +201,7 @@ endif

proc_libprocps_la_LDFLAGS = \
-version-info $(LIBprocps_CURRENT):$(LIBprocps_REVISION):$(LIBprocps_AGE) \
- -no-undefined \
- -Wl,--version-script=$(top_srcdir)/proc/libprocps.sym
+ -no-undefined

proc_libprocps_la_SOURCES = \
proc/alloc.c \
@@ -246,7 +222,6 @@ proc_libprocps_la_SOURCES = \
proc/sig.h \
proc/slab.c \
proc/slab.h \
- proc/sysinfo.c \
proc/sysinfo.h \
proc/version.c \
proc/version.h \
11 changes: 11 additions & 0 deletions components/sysutils/watch/patches/02-fix-ncurses.h.patch
@@ -0,0 +1,11 @@
--- procps-ng-3.3.15/watch.c 2018-05-17 13:23:41.674211668 +0000
+++ procps-ng-3.3.15/watch.c.new 2019-02-16 13:33:09.738837084 +0000
@@ -53,7 +53,7 @@
# include <wchar.h>
# include <wctype.h>
#endif /* WITH_WATCH8BIT */
-#include <ncurses.h>
+#include <ncurses/ncurses.h>

#ifdef FORCE_8BIT
# undef isprint
11 changes: 11 additions & 0 deletions components/sysutils/watch/patches/03-fix-config.h-inclusion.patch
@@ -0,0 +1,11 @@
--- procps-ng-3.3.15/include/nls.h 2016-11-23 21:51:08.822649334 +0000
+++ procps-ng-3.3.15/include/nls.h.new 2019-02-16 13:31:20.987876156 +0000
@@ -6,7 +6,7 @@
#define PROCPS_NG_NLS_H

/* programs issuing textdomain() need PACKAGE string */
-#include "../config.h"
+#include "config.h"

/* programs issuing bindtextdomain() also need LOCALEDIR string */
#ifndef LOCALEDIR
41 changes: 0 additions & 41 deletions components/sysutils/watch/patches/Makefile.patch

This file was deleted.

13 changes: 0 additions & 13 deletions components/sysutils/watch/patches/proc_module.mk.patch

This file was deleted.

39 changes: 38 additions & 1 deletion components/sysutils/watch/watch.p5m
Expand Up @@ -10,7 +10,7 @@
#

#
# Copyright 2016 Adam Stevko
# Copyright 2019 Michal Nowak
#

set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
Expand All @@ -23,4 +23,41 @@ set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'

file path=usr/bin/watch
#file path=usr/include/proc/alloc.h
#file path=usr/include/proc/devname.h
#file path=usr/include/proc/escape.h
#file path=usr/include/proc/numa.h
#file path=usr/include/proc/procps.h
#file path=usr/include/proc/pwcache.h
#file path=usr/include/proc/readproc.h
#file path=usr/include/proc/sig.h
#file path=usr/include/proc/slab.h
#file path=usr/include/proc/sysinfo.h
#file path=usr/include/proc/version.h
#file path=usr/include/proc/wchan.h
#file path=usr/include/proc/whattime.h
#file path=usr/lib/$(MACH64)/libprocps.a
#link path=usr/lib/$(MACH64)/libprocps.so target=libprocps.so.7.1.0
#link path=usr/lib/$(MACH64)/libprocps.so.7 target=libprocps.so.7.1.0
#file path=usr/lib/$(MACH64)/libprocps.so.7.1.0
#file path=usr/lib/$(MACH64)/pkgconfig/libprocps.pc
#file path=usr/share/doc/procps-ng/FAQ
#file path=usr/share/doc/procps-ng/bugs.md
#file path=usr/share/locale/de/LC_MESSAGES/procps-ng.mo
#file path=usr/share/locale/fr/LC_MESSAGES/procps-ng.mo
#file path=usr/share/locale/pl/LC_MESSAGES/procps-ng.mo
#file path=usr/share/locale/pt_BR/LC_MESSAGES/procps-ng.mo
#file path=usr/share/locale/sv/LC_MESSAGES/procps-ng.mo
#file path=usr/share/locale/uk/LC_MESSAGES/procps-ng.mo
#file path=usr/share/locale/vi/LC_MESSAGES/procps-ng.mo
#file path=usr/share/locale/zh_CN/LC_MESSAGES/procps-ng.mo
#file path=usr/share/man/man1/ps.1
#file path=usr/share/man/man1/pwdx.1
#file path=usr/share/man/man1/slabtop.1
#file path=usr/share/man/man1/tload.1
file path=usr/share/man/man1/watch.1
#file path=usr/share/man/man3/openproc.3
#file path=usr/share/man/man3/readproc.3
#file path=usr/share/man/man3/readproctab.3
#file path=usr/share/man/man5/sysctl.conf.5
#file path=usr/share/man/man8/sysctl.8

0 comments on commit 4ab7712

Please sign in to comment.