# ohcount を Homebrew, apt, MacPorts, zypper でインストール

ohcount のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。

## インストール

```sh
sudo av install brew:ohcount
```

追加のインストールコマンド:

### macOS

- Homebrew (100%):

```sh
brew install ohcount
```

  証拠: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install ohcount
```

  証拠: MacPorts ports tree: textproc/ohcount/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Debian apt (92%):

```sh
sudo apt install ohcount
```

  証拠: Debian stable package indexes: ohcount from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- zypper (92%):

```sh
sudo zypper install ohcount
```

  証拠: openSUSE Tumbleweed package metadata: ohcount from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## パッケージ情報

- **パッケージキー:** brew:ohcount
- **パッケージマネージャ:** Homebrew
- **バージョン:** 4.0.0
- **ソース概要:** Source code line counter
- **ホームページ:** <https://github.com/blackducksoftware/ohcount>
- **リポジトリ:** <https://github.com/blackducksoftware/ohcount>
- **最終更新:** 2026-07-11T09:50:47+09:00
- **生成日時:** 2026-08-03T19:37:03+00:00

## 実行可能ファイル

- ohcount (エイリアス)

## インストール挙動

- Bottle: 利用不可

## バージョンと鮮度

- ページ生成日: 2026-08-03
- マネージャ版: 4.0.0
## プロジェクトの歴史と使われ方

Ohcount is the Ohloh/Open Hub source-code line counter: a C and Ragel based analyzer with a command-line tool and language-detection library for counting code, comment, and blank lines across source trees.

### プロジェクトの歴史

The project traces back to Ohloh, the open-source project directory and analytics site later associated with Black Duck and Open Hub. Its README says it was originally developed at Ohloh and used to generate the reports at www.openhub.net, which makes it part of the early package-statistics infrastructure rather than just a standalone `wc`-style utility.

The original GitHub source repository was created on 2008-06-09, and the Black Duck fork used by package managers was created on 2010-10-27. The Black Duck repository kept the Ohloh identity in its description while moving the maintained packaging-facing project under the Black Duck Software organization.

### 採用の歴史

Ohcount's most important adoption story is Open Hub itself: the tool was used to generate Open Hub's source-code reports, giving it a role in public open-source metrics. It also reached mainstream Unix packaging through Homebrew, Debian, Ubuntu, MacPorts, and openSUSE-style distributions, but Homebrew analytics generated on 2026-07-01 showed a small niche user base: 49 installs over 365 days.

The package stayed interesting to distributors because it is not a single-language counter. The README describes a detector for primary language family, a parser for line-by-line breakdowns, support for multiple languages in one file, whole-directory counting, language-family file discovery, detailed source annotations, and Ruby bindings.

### 使われ方

Developers and auditors use `ohcount` to count individual files or entire directory trees, identify source files by language family, and produce detailed annotations of a file's lines. Its ability to split mixed files, such as HTML with CSS and JavaScript regions, made it more sophisticated than plain line counters.

Package builders care about its implementation details because the Homebrew formula depends on `libmagic`, `pcre2`, and `ragel`, and applies Debian patches for modern build and PCRE2 support. The README also documents Ruby 2.x test expectations, SWIG bindings, and an unsupported Python wrapper.

### パッケージ好きにとっての重要性

Ohcount is a package-nerd artifact because it helped produce package metadata about other projects. It sits in the same historical lane as SLOC counters and open-source forges: the tool is small, but the data it helped generate shaped how people compared projects by language mix and code size.

Its formula tells the story of aging infrastructure kept buildable through distro patches. The combination of Ragel-generated scanners, Ruby bindings, PCRE migration, and GPL-2.0-only licensing gives maintainers plenty of packaging surface area for a deceptively simple CLI.

### タイムライン

- 2008-06-09: the original `korsakov/ohcount` GitHub repository was created.
- 2010-10-27: Black Duck Software's GitHub fork was created.
- 2021-12-09: the README build notes recorded tested build requirements for Ubuntu, Fedora, and macOS.
- 2026-07-01: Homebrew's formula API reported stable version 4.0.0 and packaged executables under `ohcount`.

### Related projects

- Ohcount is closely tied to Ohloh/Open Hub. It is also related to other source line counters such as `cloc`, but its distinctive lineage is its use inside an open-source analytics service rather than only as a local developer utility.

### ソース

- <https://api.github.com/repos/blackducksoftware/ohcount>
- <https://formulae.brew.sh/api/formula/ohcount.json>
- <https://github.com/blackducksoftware/ohcount>
- <https://openhub.net/p/ohcount>
- <https://raw.githubusercontent.com/blackducksoftware/ohcount/main/README.md>


## セキュリティノート

narrow executable package without higher-risk signals.

- **Geiger リスク:** グリーン / 低
- narrow executable package without higher-risk signals

## 他のパッケージマネージャ記録

- Debian apt - ohcount - 4.0.0-5: normalized package name match | Debian stable package indexes: ohcount from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Source code line counter | https://github.com/blackducksoftware/ohcount
- Debian apt - ohcount-doc - 4.0.0-5: normalized package name match | Debian stable package indexes: ohcount-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Source code line counter - Documentation | https://github.com/blackducksoftware/ohcount
- Ubuntu apt - ohcount - 4.0.0-4build2: normalized package name match | Ubuntu 24.04 LTS package indexes: ohcount from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Source code line counter | https://github.com/blackducksoftware/ohcount
- Ubuntu apt - ohcount-doc - 4.0.0-4build2: normalized package name match | Ubuntu 24.04 LTS package indexes: ohcount-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Source code line counter - Documentation | https://github.com/blackducksoftware/ohcount
- zypper - ohcount - 4.0.0-3.5: normalized package name match | openSUSE Tumbleweed package metadata: ohcount from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | The Ohloh source code line counter | https://www.openhub.net/p/ohcount
- MacPorts - ohcount: normalized package name match | MacPorts ports tree: textproc/ohcount/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/ohcount.yml](https://github.com/mxcl/pkgdb/blob/main/combined/ohcount.yml)


## ソース

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
